|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwebsocket4j.AbstractWebSocket
public abstract class AbstractWebSocket
This class implements common functionality of server and client side web socket.
Constructor Summary | |
---|---|
AbstractWebSocket(java.net.Socket socket,
java.lang.Integer timeout,
java.lang.Object... args)
Creates new WebSocket instance using given socket for communication and limiting handshake time to given milliseconds. |
Method Summary | |
---|---|
void |
close()
Closes the connection. |
java.lang.String |
getMessage()
Gets a message form the other party. |
boolean |
isClosed()
Checks if this socket is closed. |
void |
sendMessage(java.lang.String message)
Sends a message to the other party. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractWebSocket(java.net.Socket socket, java.lang.Integer timeout, java.lang.Object... args) throws java.io.IOException
socket
- socket that should be used for communicationtimeout
- maximum time in milliseconds for the handshake
java.io.IOException
- exception thrown when there is communication error or
protocol errorMethod Detail |
---|
public void close() throws java.io.IOException
java.io.IOException
public java.lang.String getMessage() throws java.io.IOException
java.io.IOException
- thrown when there is a problem with the connection or
protocolpublic boolean isClosed()
public void sendMessage(java.lang.String message) throws java.io.IOException
message
- message to be sent
java.io.IOException
- thrown when there is a problem with the connection.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |