org.glassfish.grizzly.websockets
Class WebSocketServer

java.lang.Object
  extended by org.glassfish.grizzly.websockets.WebSocketServer

public class WebSocketServer
extends Object


Constructor Summary
protected WebSocketServer()
          Empty constructor, which doesn't do any network initialization.
  WebSocketServer(int port)
          Deprecated. please use createServer(int).
protected WebSocketServer(String host, PortRange portRange)
           
 
Method Summary
static WebSocketServer createServer(int port)
           
static WebSocketServer createServer(PortRange range)
           
static WebSocketServer createServer(SocketAddress socketAddress)
           
static WebSocketServer createServer(String host, int port)
           
static WebSocketServer createServer(String host, PortRange range)
           
static WebSocketServer createSimpleServer(int port)
          Deprecated. please use createServer(int).
 void register(String name, WebSocketApplication application)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebSocketServer

protected WebSocketServer()
Empty constructor, which doesn't do any network initialization.


WebSocketServer

public WebSocketServer(int port)
Deprecated. please use createServer(int).

Parameters:
port - the network port to which this listener will bind.

WebSocketServer

protected WebSocketServer(String host,
                          PortRange portRange)
Parameters:
host - the network port to which this listener will bind.
range - port range to attempt to bind to.
Method Detail

createSimpleServer

public static WebSocketServer createSimpleServer(int port)
Deprecated. please use createServer(int).

Parameters:
port - the network port to which this listener will bind.
Returns:
a WebSocketServer configured to listen to requests on NetworkListener.DEFAULT_NETWORK_HOST:port.

createServer

public static WebSocketServer createServer(int port)
Parameters:
port - the network port to which this listener will bind.
Returns:
a WebSocketServer configured to listen to requests on NetworkListener.DEFAULT_NETWORK_HOST:port.

createServer

public static WebSocketServer createServer(PortRange range)
Parameters:
range - port range to attempt to bind to.
Returns:
a WebSocketServer configured to listen to requests on NetworkListener.DEFAULT_NETWORK_HOST:[port-range].

createServer

public static WebSocketServer createServer(SocketAddress socketAddress)
Parameters:
socketAddress - the endpoint address to which this listener will bind.
Returns:
a WebSocketServer configured to listen to requests on socketAddress.

createServer

public static WebSocketServer createServer(String host,
                                           int port)
Parameters:
host - the network port to which this listener will bind.
port - the network port to which this listener will bind.
Returns:
a WebSocketServer configured to listen to requests on host:port.

createServer

public static WebSocketServer createServer(String host,
                                           PortRange range)
Parameters:
host - the network port to which this listener will bind.
range - port range to attempt to bind to.
Returns:
a WebSocketServer configured to listen to requests on host:[port-range].

start

public void start()
           throws IOException
Throws:
IOException

stop

public void stop()

register

public void register(String name,
                     WebSocketApplication application)


Copyright © 2012 Oracle Corporation. All Rights Reserved.