public class MoldUDP64Client extends Object implements Closeable
Constructor and Description |
---|
MoldUDP64Client(DatagramChannel channel,
DatagramChannel requestChannel,
SocketAddress requestAddress,
MessageListener listener,
MoldUDP64ClientStatusListener statusListener)
Create a MoldUDP64 client.
|
MoldUDP64Client(DatagramChannel channel,
DatagramChannel requestChannel,
SocketAddress requestAddress,
MessageListener listener,
MoldUDP64ClientStatusListener statusListener,
long requestedSequenceNumber)
Create a MoldUDP64 client.
|
MoldUDP64Client(DatagramChannel channel,
SocketAddress requestAddress,
MessageListener listener,
MoldUDP64ClientStatusListener statusListener)
Create a MoldUDP64 client.
|
MoldUDP64Client(DatagramChannel channel,
SocketAddress requestAddress,
MessageListener listener,
MoldUDP64ClientStatusListener statusListener,
long requestedSequenceNumber)
Create a MoldUDP64 client.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the underlying datagram channels.
|
DatagramChannel |
getChannel()
Get the underlying datagram channel.
|
DatagramChannel |
getRequestChannel()
Get the underlying request datagram channel.
|
void |
receive()
Receive data from the underlying datagram channel.
|
void |
receiveResponse()
Receive data from the underlying request datagram channel.
|
public MoldUDP64Client(DatagramChannel channel, SocketAddress requestAddress, MessageListener listener, MoldUDP64ClientStatusListener statusListener)
channel
- the underlying datagram channelrequestAddress
- the request addresslistener
- the message listenerstatusListener
- the status listenerpublic MoldUDP64Client(DatagramChannel channel, SocketAddress requestAddress, MessageListener listener, MoldUDP64ClientStatusListener statusListener, long requestedSequenceNumber)
Set the requested initial sequence number to 0 to start from the first received message.
channel
- the underlying datagram channelrequestAddress
- the request addresslistener
- the message listenerstatusListener
- the status listenerrequestedSequenceNumber
- the requested initial sequence numberpublic MoldUDP64Client(DatagramChannel channel, DatagramChannel requestChannel, SocketAddress requestAddress, MessageListener listener, MoldUDP64ClientStatusListener statusListener)
channel
- the underlying datagram channelrequestChannel
- the underlying request datagram channelrequestAddress
- the request addresslistener
- the message listenerstatusListener
- the status listenerpublic MoldUDP64Client(DatagramChannel channel, DatagramChannel requestChannel, SocketAddress requestAddress, MessageListener listener, MoldUDP64ClientStatusListener statusListener, long requestedSequenceNumber)
Set the requested initial sequence number to 0 to start from the first received message.
channel
- the underlying datagram channelrequestChannel
- the underlying request datagram channelrequestAddress
- the request addresslistener
- the message listenerstatusListener
- the status listenerrequestedSequenceNumber
- the requested initial sequence numberpublic DatagramChannel getChannel()
public DatagramChannel getRequestChannel()
public void receive() throws IOException
IOException
- if an I/O error occurspublic void receiveResponse() throws IOException
IOException
- if an I/O error occurspublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
- if an I/O error occursCopyright © 2017. All rights reserved.