public class MoldUDP64RequestServer extends Object implements Closeable
Constructor and Description |
---|
MoldUDP64RequestServer(DatagramChannel channel)
Create a request server.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the underlying datagram channel.
|
DatagramChannel |
getChannel()
Get the underlying datagram channel.
|
void |
serve(MoldUDP64MessageStore store)
Serve a request.
|
public MoldUDP64RequestServer(DatagramChannel channel)
channel
- the underlying datagram channelpublic DatagramChannel getChannel()
public void serve(MoldUDP64MessageStore store) throws IOException
Retrieve messages from the message store based on the sequence number and the requested message count in the request packet.
store
- a message storeIOException
- 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.