com.sun.grizzly.websockets
Class NioClientNetworkHandler

java.lang.Object
  extended by com.sun.grizzly.websockets.NioClientNetworkHandler
All Implemented Interfaces:
NetworkHandler

public class NioClientNetworkHandler
extends Object
implements NetworkHandler


Constructor Summary
NioClientNetworkHandler(Selector channelSelector, NioClientWebSocket socket)
           
 
Method Summary
protected  void doConnect(boolean finishNioConnect)
           
 byte get()
           
 SelectionKey getKey()
           
 WebSocket getWebSocket()
           
 boolean peek(byte... bytes)
           
 void process(SelectionKey key)
           
protected  void readFrame()
           
 void send(DataFrame frame)
           
 void setChannel(SocketChannel channel)
           
 void setWebSocket(WebSocket webSocket)
           
 void shutdown()
           
protected  void write(byte[] bytes)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NioClientNetworkHandler

public NioClientNetworkHandler(Selector channelSelector,
                               NioClientWebSocket socket)
                        throws IOException
Throws:
IOException
Method Detail

setChannel

public void setChannel(SocketChannel channel)

send

public void send(DataFrame frame)
          throws IOException
Specified by:
send in interface NetworkHandler
Throws:
IOException

getKey

public SelectionKey getKey()

process

public void process(SelectionKey key)
             throws IOException
Throws:
IOException

doConnect

protected void doConnect(boolean finishNioConnect)
                  throws IOException
Throws:
IOException

write

protected void write(byte[] bytes)
              throws IOException
Throws:
IOException

shutdown

public void shutdown()
              throws IOException
Throws:
IOException

getWebSocket

public WebSocket getWebSocket()

setWebSocket

public void setWebSocket(WebSocket webSocket)
Specified by:
setWebSocket in interface NetworkHandler

readFrame

protected void readFrame()
                  throws IOException
Throws:
IOException

get

public byte get()
         throws IOException
Specified by:
get in interface NetworkHandler
Throws:
IOException

peek

public boolean peek(byte... bytes)
             throws IOException
Specified by:
peek in interface NetworkHandler
Throws:
IOException


Copyright © 2011 Oracle Corpration. All Rights Reserved.