Class DefaultNetMessageHandler
- java.lang.Object
-
- org.bidib.jbidibc.net.serialovertcp.DefaultNetMessageHandler
-
- All Implemented Interfaces:
NetMessageHandler
public class DefaultNetMessageHandler extends Object implements NetMessageHandler
-
-
Constructor Summary
Constructors Constructor Description DefaultNetMessageHandler(org.bidib.jbidibc.messages.MessageReceiver messageReceiverDelegate, InetAddress address, int port, org.bidib.jbidibc.messages.ConnectionListener connectionListener)Creates a new instance of DefaultNetMessageHandler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidacceptClient(String remoteHost)Accept new client.voidcleanup(String remoteHost)Cleanup the connection of the client.voidreceive(DataPacket packet)Receive messages from the configured portvoidsend(NetBidibPort port, byte[] bytes)Send data to the port.
-
-
-
Constructor Detail
-
DefaultNetMessageHandler
public DefaultNetMessageHandler(org.bidib.jbidibc.messages.MessageReceiver messageReceiverDelegate, InetAddress address, int port, org.bidib.jbidibc.messages.ConnectionListener connectionListener)Creates a new instance of DefaultNetMessageHandler.- Parameters:
messageReceiverDelegate- the delegate message receiver that processes the BiDiB messagesaddress- the address of the master to connect toport- the port of the master to connect toconnectionListener- the connection listener
-
-
Method Detail
-
receive
public void receive(DataPacket packet)
Description copied from interface:NetMessageHandlerReceive messages from the configured port- Specified by:
receivein interfaceNetMessageHandler- Parameters:
packet- the received data
-
send
public void send(NetBidibPort port, byte[] bytes)
Description copied from interface:NetMessageHandlerSend data to the port.- Specified by:
sendin interfaceNetMessageHandler- Parameters:
port- the portbytes- the data
-
acceptClient
public void acceptClient(String remoteHost)
Description copied from interface:NetMessageHandlerAccept new client.- Specified by:
acceptClientin interfaceNetMessageHandler- Parameters:
remoteHost- the host
-
cleanup
public void cleanup(String remoteHost)
Description copied from interface:NetMessageHandlerCleanup the connection of the client.- Specified by:
cleanupin interfaceNetMessageHandler
-
-