Package serverLogic
Class UdpServerConnection
java.lang.Object
serverLogic.UdpServerConnection
- All Implemented Interfaces:
ServerConnection
- Direct Known Subclasses:
UdpConnectionBlockDecorator
-
Field Summary
Modifier and TypeFieldDescriptionprotected SocketAddress
static final int
protected final DatagramChannel
-
Constructor Summary
ModifierConstructorDescriptionprotected
UdpServerConnection
(DatagramChannel channel, SocketAddress address) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Method for close a connectionvoid
Method for open a connection.sendData
(byte[] bytesToSend) Method for send data to a server
-
Field Details
-
BUFFER_SIZE
public static final int BUFFER_SIZE- See Also:
-
channel
-
address
-
-
Constructor Details
-
UdpServerConnection
-
-
Method Details
-
openConnection
Method for open a connection.- Specified by:
openConnection
in interfaceServerConnection
- Throws:
IOException
- if I/O occurs
-
closeConnection
Method for close a connection- Specified by:
closeConnection
in interfaceServerConnection
- Throws:
IOException
- if I/O occurs
-
sendData
Description copied from interface:ServerConnection
Method for send data to a server- Specified by:
sendData
in interfaceServerConnection
- Parameters:
bytesToSend
- bytes to send- Returns:
- Response from a server
- Throws:
IOException
- if I/O occurs
-