|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectwebsocket4j.server.WebServerSocket
public class WebServerSocket
Server socket that accepts WebSockets.
| Constructor Summary | |
|---|---|
WebServerSocket()
Creates new WebServerSocket on random port. |
|
WebServerSocket(java.lang.Integer port)
Creates new WebServerSocket on given port. |
|
| Method Summary | |
|---|---|
WebSocket |
accept()
Accepts a new connection to the socket. |
void |
close()
Closes the socket. |
java.lang.Integer |
getLocalPort()
Returns local port to which this socket is bound. |
java.lang.Boolean |
isClosed()
Checks if this socket is closed. |
void |
setSoTimeout(java.lang.Integer timeout)
Sets maximum timeout for accept. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WebServerSocket()
throws java.io.IOException
java.io.IOException - thrown when there is an error while creating a new socket.
public WebServerSocket(java.lang.Integer port)
throws java.io.IOException
port - port to use
java.io.IOException - thrown when there is an error while creating a new socket.| Method Detail |
|---|
public void setSoTimeout(java.lang.Integer timeout)
throws java.net.SocketException
timeout - maximum timeout for accept in milliseconds
java.net.SocketException - thrown when there is an error while setting the timeoutpublic java.lang.Integer getLocalPort()
public java.lang.Boolean isClosed()
public void close()
throws java.io.IOException
java.io.IOException - thrown when an error occurs while closing the socket
public WebSocket accept()
throws java.io.IOException
WebSocket that was accepted
java.io.IOException - thrown when there is a problem with connection or protocol
error
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||