Package marauroa.server.net
Interface IServerManager
- All Known Implementing Classes:
NetworkServerManager
public interface IServerManager
This interface allows ConnectionManagers to talk to the central server manager.
- Author:
- miguel
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addServer(ConnectionManager server)
Adds a server to the workeronConnect(ConnectionManager server, InetSocketAddress address, Object internalChannel)
This is a callback method that is called onConnectvoid
onDisconnect(ConnectionManager server, Object internalChannel)
This method is called when the client is disconnectedvoid
onMessage(ConnectionManager server, Object internalChannel, Message message)
This method is called when data is received from a socket channelvoid
Register a listener for disconnection events.
-
Method Details
-
addServer
Adds a server to the worker- Parameters:
server
- IServer
-
onConnect
This is a callback method that is called onConnect- Parameters:
server
- IServeraddress
- of the clientinternalChannel
- internal channel object- Returns:
- the channel, if the connection was accepted;
null
otherwise
-
onMessage
This method is called when data is received from a socket channel- Parameters:
server
- ConnectionManagerinternalChannel
- internal channel objectmessage
- a Message
-
onDisconnect
This method is called when the client is disconnected- Parameters:
server
- ConnectionManagerinternalChannel
- internal channel object
-
registerDisconnectedListener
Register a listener for disconnection events.- Parameters:
listener
- a listener for disconnection events.
-