|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xsocket.datagram.ConnectedEndpoint
public final class ConnectedEndpoint
connected endpoint implementation
Field Summary |
---|
Fields inherited from interface org.xsocket.datagram.IEndpoint |
---|
DEFAULT_HOST_ADDRESS, IP_MULTICAST_LOOP, IP_MULTICAST_TTL, IP_TOS, SO_BROADCAST, SO_RCVBUF, SO_REUSEADDR, SO_SNDBUF |
Constructor Summary | |
---|---|
ConnectedEndpoint(java.net.SocketAddress remoteAddress)
Constructs a client/server datagram socket and binds it to any available port on the local host machine. |
|
ConnectedEndpoint(java.net.SocketAddress remoteAddress,
DatagramSocketConfiguration socketConfiguration)
Deprecated. |
|
ConnectedEndpoint(java.net.SocketAddress remoteAddress,
DatagramSocketConfiguration socketConfiguration,
int receivePacketSize)
Deprecated. |
|
ConnectedEndpoint(java.net.SocketAddress remoteAddress,
DatagramSocketConfiguration socketConfiguration,
int receivePacketSize,
IDatagramHandler datagramHandler)
Deprecated. |
|
ConnectedEndpoint(java.net.SocketAddress remoteAddress,
DatagramSocketConfiguration socketConfiguration,
int receivePacketSize,
IDatagramHandler datagramHandler,
java.util.concurrent.Executor workerPool)
Deprecated. |
|
ConnectedEndpoint(java.net.SocketAddress remoteAddress,
int receivePacketSize)
Constructs a client/server datagram socket and binds it to the given available port on the local host machine. |
|
ConnectedEndpoint(java.net.SocketAddress remoteAddress,
int receivePacketSize,
IDatagramHandler datagramHandler)
Constructs a client/server datagram socket and binds it to the given available port on the local host machine. |
|
ConnectedEndpoint(java.net.SocketAddress remoteAddress,
java.util.Map<java.lang.String,java.lang.Object> options,
int receivePacketSize,
IDatagramHandler datagramHandler,
java.util.concurrent.Executor workerPool)
Constructs a client/server datagram socket and binds it to the given available port on the local host machine. |
|
ConnectedEndpoint(java.lang.String host,
int port)
Constructs a client/server datagram socket and binds it to any available port on the local host machine. |
|
ConnectedEndpoint(java.lang.String host,
int port,
DatagramSocketConfiguration socketConfiguration)
Deprecated. |
|
ConnectedEndpoint(java.lang.String host,
int port,
DatagramSocketConfiguration socketConfiguration,
int receivePacketSize)
Deprecated. |
|
ConnectedEndpoint(java.lang.String host,
int port,
int receivePacketSize)
Constructs a client/server datagram socket and binds it to the given available port on the local host machine. |
Method Summary | |
---|---|
void |
close()
|
java.lang.String |
getDefaultEncoding()
gets the default encoding used by this endpoint |
java.lang.String |
getId()
return the id |
java.net.InetAddress |
getLocalAddress()
returns the address of the endpoint |
int |
getLocalPort()
returns the port of the endpoint |
java.net.SocketAddress |
getLocalSocketAddress()
Deprecated. |
java.lang.Object |
getOption(java.lang.String name)
returns the vlaue of a option |
java.util.Map<java.lang.String,java.lang.Class> |
getOptions()
Returns an unmodifiable map of the options supported by this endpont. |
int |
getReceiveSize()
get the size of the datagram that will be received |
java.net.SocketAddress |
getRemoteSocketAddress()
return the connected remote address or null if not connected |
java.util.concurrent.Executor |
getWorkerpool()
return the worker pool |
IWorkerPool |
getWorkerPool()
Deprecated. |
boolean |
isOpen()
returns, if the endpoint is open |
UserDatagram |
receive()
receive a datagram packet (receive timeout = 0) |
UserDatagram |
receive(long timeoutMillis)
receive a datagram packet |
void |
send(UserDatagram packet)
send a datagram to the remote endpoint |
void |
setDefaultEncoding(java.lang.String defaultEncoding)
sets the default encoding used by this endpoint |
void |
setReceiveSize(int receivePacketSize)
set the size of the datagram that will be received |
void |
setWorkerPool(IWorkerPool workerPool)
Deprecated. |
java.lang.String |
toCompactString()
a compact string of this endpoint |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.xsocket.datagram.IEndpoint |
---|
getDefaultEncoding, getId, getLocalAddress, getLocalPort, getLocalSocketAddress, getOption, getOptions, getReceiveSize, isOpen, receive, receive, setDefaultEncoding, setReceiveSize, setWorkerPool |
Methods inherited from interface java.io.Closeable |
---|
close |
Constructor Detail |
---|
public ConnectedEndpoint(java.lang.String host, int port) throws java.io.IOException
host
- the remote hostport
- the remote port
java.io.IOException
- If some I/O error occurspublic ConnectedEndpoint(java.lang.String host, int port, DatagramSocketConfiguration socketConfiguration) throws java.io.IOException
java.io.IOException
public ConnectedEndpoint(java.net.SocketAddress remoteAddress) throws java.io.IOException
java.io.IOException
- If some I/O error occurspublic ConnectedEndpoint(java.net.SocketAddress remoteAddress, DatagramSocketConfiguration socketConfiguration) throws java.io.IOException
java.io.IOException
public ConnectedEndpoint(java.net.SocketAddress remoteAddress, int receivePacketSize) throws java.io.IOException
remoteAddress
- the remote socket addressreceivePacketSize
- the receive packet size
java.io.IOException
- If some I/O error occurspublic ConnectedEndpoint(java.net.SocketAddress remoteAddress, DatagramSocketConfiguration socketConfiguration, int receivePacketSize) throws java.io.IOException
java.io.IOException
public ConnectedEndpoint(java.lang.String host, int port, int receivePacketSize) throws java.io.IOException
host
- the remote hostport
- the remote portreceivePacketSize
- the receive packet size
java.io.IOException
- If some I/O error occurspublic ConnectedEndpoint(java.lang.String host, int port, DatagramSocketConfiguration socketConfiguration, int receivePacketSize) throws java.io.IOException
java.io.IOException
public ConnectedEndpoint(java.net.SocketAddress remoteAddress, int receivePacketSize, IDatagramHandler datagramHandler) throws java.io.IOException
remoteAddress
- the remote socket addressreceivePacketSize
- the receive packet sizedatagramHandler
- the datagram handler
java.io.IOException
- If some I/O error occurspublic ConnectedEndpoint(java.net.SocketAddress remoteAddress, DatagramSocketConfiguration socketConfiguration, int receivePacketSize, IDatagramHandler datagramHandler) throws java.io.IOException
java.io.IOException
public ConnectedEndpoint(java.net.SocketAddress remoteAddress, DatagramSocketConfiguration socketConfiguration, int receivePacketSize, IDatagramHandler datagramHandler, java.util.concurrent.Executor workerPool) throws java.io.IOException
java.io.IOException
public ConnectedEndpoint(java.net.SocketAddress remoteAddress, java.util.Map<java.lang.String,java.lang.Object> options, int receivePacketSize, IDatagramHandler datagramHandler, java.util.concurrent.Executor workerPool) throws java.io.IOException
remoteAddress
- the remote socket addresssocketOptions
- the socket optionsreceivePacketSize
- the receive packet sizedatagramHandler
- the datagram handlerworkerPool
- the worker pool
java.io.IOException
- If some I/O error occursMethod Detail |
---|
public void send(UserDatagram packet) throws java.io.IOException
send
in interface IEndpoint
packet
- the datagram to send
java.io.IOException
- If some other I/O error occurs
ClosedConnectionException
- if the underlying channel is closedpublic java.net.SocketAddress getRemoteSocketAddress()
getRemoteSocketAddress
in interface IConnectedEndpoint
public final void close()
close
in interface java.io.Closeable
public final java.net.SocketAddress getLocalSocketAddress()
getLocalSocketAddress
in interface IEndpoint
public final java.net.InetAddress getLocalAddress()
getLocalAddress
in interface IEndpoint
public final int getLocalPort()
getLocalPort
in interface IEndpoint
public final boolean isOpen()
isOpen
in interface IEndpoint
public java.lang.String toCompactString()
public java.lang.Object getOption(java.lang.String name) throws java.io.IOException
getOption
in interface IEndpoint
name
- the name of the option
java.io.IOException
- In an I/O error occurspublic java.util.Map<java.lang.String,java.lang.Class> getOptions()
IEndpoint
getOptions
in interface IEndpoint
public void setWorkerPool(IWorkerPool workerPool)
setWorkerPool
in interface IEndpoint
workerPool
- the worker pool to usepublic IWorkerPool getWorkerPool()
public java.util.concurrent.Executor getWorkerpool()
public final void setReceiveSize(int receivePacketSize)
setReceiveSize
in interface IEndpoint
receivePacketSize
- the receive sizepublic final int getReceiveSize()
getReceiveSize
in interface IEndpoint
public final UserDatagram receive(long timeoutMillis) throws java.io.IOException, java.net.SocketTimeoutException
receive
in interface IEndpoint
timeoutMillis
- the receive timeout in millis
java.net.SocketTimeoutException
- If the receive timeout has been reached
java.io.IOException
- If some other I/O error occurspublic UserDatagram receive()
IEndpoint
receive
in interface IEndpoint
public final java.lang.String getDefaultEncoding()
getDefaultEncoding
in interface IEndpoint
public final void setDefaultEncoding(java.lang.String defaultEncoding)
setDefaultEncoding
in interface IEndpoint
defaultEncoding
- the default encodingpublic final java.lang.String getId()
getId
in interface IEndpoint
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |