public class Address_InterProcessComm_Socket extends java.lang.Object implements Address_InterProcessComm
Modifier and Type | Field and Description |
---|---|
private java.net.InetSocketAddress |
socketAddr |
private java.lang.String |
type
UDP, TCP
|
static int |
version
Version, history and license.
|
Constructor and Description |
---|
Address_InterProcessComm_Socket()
Empty constructor to call setLocalHostPort later
|
Address_InterProcessComm_Socket(java.lang.String addr)
Constructor with address given as String.
|
Address_InterProcessComm_Socket(java.lang.String type,
int addr,
int port)
Constructor with full destination address given as 32-bit-integer value.
|
Address_InterProcessComm_Socket(java.lang.String type,
java.lang.String addr,
int port)
Constructor with type, address and port.
|
Modifier and Type | Method and Description |
---|---|
(package private) java.net.InetSocketAddress |
getSocketAddress()
gets the pointer to the socket address.
|
void |
setLocalHostPort(int port)
Creates an destination adress at local host
|
void |
setReceiveSocket(int port)
Sets an receive socket on any local IP-Address.
|
(package private) void |
storeSender(java.net.SocketAddress sender)
store the socket Address into, only usefully if it is a SenderAddressInterProcessComm.
|
java.lang.String |
toString() |
public static final int version
toString()
does not returns the hostName, this needs communication
and a DNS. Instead it returns the address (ip-number)
private java.net.InetSocketAddress socketAddr
private final java.lang.String type
public Address_InterProcessComm_Socket()
public Address_InterProcessComm_Socket(java.lang.String type, int addr, int port)
addr
- The inet destination adress, Hi bytes are left, example 192.168.10.1 is 0xc0a80a01port
- The port of destination.public Address_InterProcessComm_Socket(java.lang.String addr)
addr
- The address inclusively type given in string format with port. Example "UDP:192.168.10.1:1234"
The type and the port is separated by ':'.public Address_InterProcessComm_Socket(java.lang.String type, java.lang.String addr, int port)
type
- The type should be "UDP", "TCP" or it may be null. If the type is null, the type is gotten
from the addr-parameter as string-part before a ':'.addr
- The address. If type and port are given, it is a String which is compatible to
java.net.InetSocketAddress. Usual it is a String with 4 octets with numbers
like "192.168.1.1". If the type is not given, the type is contained in this parameter
before a ':'. If the port is not given the port is the integer number after a trailing ':'.port
- A positive value for the Port number or -1 if the port is contained in addr.public java.lang.String toString()
toString
in class java.lang.Object
public void setLocalHostPort(int port)
port
- the portnumber at localhostpublic void setReceiveSocket(int port)
java.net.InetSocketAddress getSocketAddress()
void storeSender(java.net.SocketAddress sender)
InterProcessComm_SocketImpl
sender
- The sender address.