|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsynergynetframework.appsystem.services.net.objectmessaging.Server
public class Server
The Class Server.
Constructor Summary | |
---|---|
Server()
Instantiates a new server. |
|
Server(int bufferSize)
Instantiates a new server. |
Method Summary | |
---|---|
void |
addMessageHandler(MessageHandler handler)
Adds the message handler. |
void |
bind(int tcpPort)
Bind. |
void |
bind(int tcpPort,
int udpPort)
Bind. |
void |
close()
Close. |
java.util.Queue<ConnectionHandler> |
getHandlers()
Gets the handlers. |
java.lang.Thread |
getUpdateThread()
Gets the update thread. |
boolean |
isRunning()
Checks if is running. |
void |
removeMessageHandler(MessageHandler handler)
Removes the message handler. |
void |
run()
|
void |
sendMessage(short connectionID,
Message message)
Send message. |
void |
sendMessageToAll(Message message)
Send message to all. |
void |
sendMessageToAllExcept(short connectionID,
Message message)
Send message to all except. |
void |
sendToAllExceptTCP(short connectionID,
java.lang.Object object)
Send to all except tcp. |
void |
sendToAllExceptUDP(short connectionID,
java.lang.Object object)
Send to all except udp. |
void |
sendToAllTCP(java.lang.Object object)
Send to all tcp. |
void |
sendToAllUDP(java.lang.Object object)
Send to all udp. |
void |
sendToTCP(short connectionID,
java.lang.Object object)
Send to tcp. |
void |
sendToUDP(short connectionID,
java.lang.Object object)
Send to udp. |
void |
stop()
Stop. |
void |
update(int timeout)
Update. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Server()
public Server(int bufferSize)
bufferSize
- the buffer sizeMethod Detail |
---|
public void addMessageHandler(MessageHandler handler)
EndPoint
addMessageHandler
in interface EndPoint
handler
- the handlerpublic void bind(int tcpPort) throws java.io.IOException
tcpPort
- the tcp port
java.io.IOException
- Signals that an I/O exception has occurred.public void bind(int tcpPort, int udpPort) throws java.io.IOException
tcpPort
- the tcp portudpPort
- the udp port
java.io.IOException
- Signals that an I/O exception has occurred.public void close()
EndPoint
close
in interface EndPoint
public java.util.Queue<ConnectionHandler> getHandlers()
public java.lang.Thread getUpdateThread()
EndPoint
getUpdateThread
in interface EndPoint
public boolean isRunning()
public void removeMessageHandler(MessageHandler handler)
EndPoint
removeMessageHandler
in interface EndPoint
handler
- the handlerpublic void run()
run
in interface java.lang.Runnable
run
in interface EndPoint
public void sendMessage(short connectionID, Message message) throws java.io.IOException
connectionID
- the connection idmessage
- the message
java.io.IOException
- Signals that an I/O exception has occurred.public void sendMessageToAll(Message message) throws java.io.IOException
message
- the message
java.io.IOException
- Signals that an I/O exception has occurred.public void sendMessageToAllExcept(short connectionID, Message message) throws java.io.IOException
connectionID
- the connection idmessage
- the message
java.io.IOException
- Signals that an I/O exception has occurred.public void sendToAllExceptTCP(short connectionID, java.lang.Object object) throws java.io.IOException
connectionID
- the connection idobject
- the object
java.io.IOException
- Signals that an I/O exception has occurred.public void sendToAllExceptUDP(short connectionID, java.lang.Object object) throws java.io.IOException
connectionID
- the connection idobject
- the object
java.io.IOException
- Signals that an I/O exception has occurred.public void sendToAllTCP(java.lang.Object object) throws java.io.IOException
object
- the object
java.io.IOException
- Signals that an I/O exception has occurred.public void sendToAllUDP(java.lang.Object object) throws java.io.IOException
object
- the object
java.io.IOException
- Signals that an I/O exception has occurred.public void sendToTCP(short connectionID, java.lang.Object object) throws java.io.IOException
connectionID
- the connection idobject
- the object
java.io.IOException
- Signals that an I/O exception has occurred.public void sendToUDP(short connectionID, java.lang.Object object) throws java.io.IOException
connectionID
- the connection idobject
- the object
java.io.IOException
- Signals that an I/O exception has occurred.public void stop()
EndPoint
stop
in interface EndPoint
public void update(int timeout) throws java.io.IOException
EndPoint
update
in interface EndPoint
timeout
- the timeout
java.io.IOException
- Signals that an I/O exception has occurred.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |