Package server.logic.udp
Class UdpServerConnection
java.lang.Object
server.logic.udp.UdpServerConnection
- All Implemented Interfaces:
LargeResponseHandler,ServerConnection
- Direct Known Subclasses:
UdpConnectionBlockDecorator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SocketAddressstatic final intprotected final DatagramChannel -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedUdpServerConnection(DatagramChannel channel, SocketAddress address) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLoopListener(ListenLoopListener listener) voidaddResponseListeners(ServerResponseProvider... providers) voidMethod for close a connectionvoidMethod for open a connection.voidreadLargeObject(int packetsCount, LargePacketProvider... packetProviders) voidremoveLoopListener(ListenLoopListener listener) voidremoveResponseListeners(ServerResponseProvider... providers) voidsendData(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:
openConnectionin interfaceServerConnection- Throws:
IOException- if I/O occurs
-
closeConnection
Method for close a connection- Specified by:
closeConnectionin interfaceServerConnection- Throws:
IOException- if I/O occurs
-
sendData
Description copied from interface:ServerConnectionMethod for send data to a server- Specified by:
sendDatain interfaceServerConnection- Parameters:
bytesToSend- bytes to send- Throws:
IOException- if I/O occurs
-
addResponseListeners
- Specified by:
addResponseListenersin interfaceServerConnection
-
removeResponseListeners
- Specified by:
removeResponseListenersin interfaceServerConnection
-
getLargeResponseHandler
- Specified by:
getLargeResponseHandlerin interfaceServerConnection
-
readLargeObject
- Specified by:
readLargeObjectin interfaceLargeResponseHandler
-
addLoopListener
- Specified by:
addLoopListenerin interfaceServerConnection
-
removeLoopListener
- Specified by:
removeLoopListenerin interfaceServerConnection
-