Package dev.server
Class DevServer
- java.lang.Object
-
- org.java_websocket.WebSocketAdapter
-
- org.java_websocket.AbstractWebSocket
-
- org.java_websocket.server.WebSocketServer
-
- dev.server.DevServer
-
- All Implemented Interfaces:
java.lang.Runnable
,org.java_websocket.WebSocketListener
public class DevServer extends org.java_websocket.server.WebSocketServer
This class allows one client at a time to connect and control the hexapod.
-
-
Field Summary
Fields Modifier and Type Field Description protected static int
PORT
-
Method Summary
Modifier and Type Method Description static java.net.InetAddress
getIPAddr()
Get the public IP-address in the local networkstatic void
main(java.lang.String[] args)
void
onClose(org.java_websocket.WebSocket conn, int arg1, java.lang.String arg2, boolean arg3)
void
onError(org.java_websocket.WebSocket conn, java.lang.Exception e)
void
onMessage(org.java_websocket.WebSocket conn, java.lang.String msg)
void
onOpen(org.java_websocket.WebSocket conn, org.java_websocket.handshake.ClientHandshake arg1)
void
onStart()
-
Methods inherited from class org.java_websocket.server.WebSocketServer
addConnection, allocateBuffers, broadcast, broadcast, broadcast, broadcast, broadcast, broadcast, createBuffer, getAddress, getConnections, getDraft, getLocalSocketAddress, getPort, getRemoteSocketAddress, getWebSocketFactory, onCloseInitiated, onClosing, onConnect, onMessage, onWebsocketClose, onWebsocketCloseInitiated, onWebsocketClosing, onWebsocketError, onWebsocketMessage, onWebsocketMessage, onWebsocketOpen, onWriteDemand, queue, releaseBuffers, removeConnection, run, setWebSocketFactory, start, stop, stop
-
Methods inherited from class org.java_websocket.AbstractWebSocket
getConnectionLostTimeout, isReuseAddr, isTcpNoDelay, setConnectionLostTimeout, setReuseAddr, setTcpNoDelay, startConnectionLostTimer, stopConnectionLostTimer
-
-
-
-
Method Detail
-
main
public static void main(java.lang.String[] args)
-
getIPAddr
public static java.net.InetAddress getIPAddr() throws java.net.SocketException
Get the public IP-address in the local network- Returns:
- The device's
InetAddress
in the local network - Throws:
java.net.SocketException
- Thrown byNetworkInterface.getNetworkInterfaces()
-
onClose
public void onClose(org.java_websocket.WebSocket conn, int arg1, java.lang.String arg2, boolean arg3)
- Specified by:
onClose
in classorg.java_websocket.server.WebSocketServer
-
onError
public void onError(org.java_websocket.WebSocket conn, java.lang.Exception e)
- Specified by:
onError
in classorg.java_websocket.server.WebSocketServer
-
onMessage
public void onMessage(org.java_websocket.WebSocket conn, java.lang.String msg)
- Specified by:
onMessage
in classorg.java_websocket.server.WebSocketServer
-
onOpen
public void onOpen(org.java_websocket.WebSocket conn, org.java_websocket.handshake.ClientHandshake arg1)
- Specified by:
onOpen
in classorg.java_websocket.server.WebSocketServer
-
onStart
public void onStart()
- Specified by:
onStart
in classorg.java_websocket.server.WebSocketServer
-
-