com.sun.grizzly.nio.transport
Class UDPNIOConnectorHandler

java.lang.Object
  extended by com.sun.grizzly.AbstractSocketConnectorHandler
      extended by com.sun.grizzly.nio.transport.UDPNIOConnectorHandler
All Implemented Interfaces:
SocketConnectorHandler

public class UDPNIOConnectorHandler
extends AbstractSocketConnectorHandler

UDP NIO transport client side ConnectorHandler implementation

Author:
Alexey Stashok

Field Summary
protected  int connectionTimeout
           
protected static int DEFAULT_CONNECTION_TIMEOUT
           
protected  boolean isReuseAddress
           
 
Fields inherited from class com.sun.grizzly.AbstractSocketConnectorHandler
defaultProcessor, defaultProcessorSelector, transport
 
Constructor Summary
UDPNIOConnectorHandler(UDPNIOTransport transport)
           
 
Method Summary
 Future<Connection> connect()
          Creates non-connected UDP Connection.
 Future<Connection> connect(SocketAddress remoteAddress, SocketAddress localAddress)
          Creates, initializes socket, binds it to the specific local and remote SocketAddress and returns Connection, representing socket.
protected  Future<Connection> connectAsync(SocketAddress remoteAddress, SocketAddress localAddress)
           
protected  Future<Connection> connectSync(SocketAddress remoteAddress, SocketAddress localAddress)
           
 int getConnectionTimeout()
           
 boolean isReuseAddress()
           
 void setConnectionTimeout(int connectionTimeout)
           
 void setReuseAddress(boolean isReuseAddress)
           
protected
<E> E
waitNIOFuture(Future<E> future)
           
 
Methods inherited from class com.sun.grizzly.AbstractSocketConnectorHandler
connect, connect, getProcessor, getProcessorSelector, setProcessor, setProcessorSelector
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CONNECTION_TIMEOUT

protected static final int DEFAULT_CONNECTION_TIMEOUT
See Also:
Constant Field Values

isReuseAddress

protected boolean isReuseAddress

connectionTimeout

protected int connectionTimeout
Constructor Detail

UDPNIOConnectorHandler

public UDPNIOConnectorHandler(UDPNIOTransport transport)
Method Detail

connect

public Future<Connection> connect()
                           throws IOException
Creates non-connected UDP Connection.

Returns:
non-connected UDP Connection.
Throws:
IOException

connect

public Future<Connection> connect(SocketAddress remoteAddress,
                                  SocketAddress localAddress)
                           throws IOException
Description copied from interface: SocketConnectorHandler
Creates, initializes socket, binds it to the specific local and remote SocketAddress and returns Connection, representing socket.

Specified by:
connect in interface SocketConnectorHandler
Specified by:
connect in class AbstractSocketConnectorHandler
Parameters:
remoteAddress - remote address to connect to.
localAddress - local address to bind socket to.
Returns:
Future of connect operation, which could be used to get resulting Connection.
Throws:
IOException

connectSync

protected Future<Connection> connectSync(SocketAddress remoteAddress,
                                         SocketAddress localAddress)
                                  throws IOException
Throws:
IOException

connectAsync

protected Future<Connection> connectAsync(SocketAddress remoteAddress,
                                          SocketAddress localAddress)
                                   throws IOException
Throws:
IOException

isReuseAddress

public boolean isReuseAddress()

setReuseAddress

public void setReuseAddress(boolean isReuseAddress)

getConnectionTimeout

public int getConnectionTimeout()

setConnectionTimeout

public void setConnectionTimeout(int connectionTimeout)

waitNIOFuture

protected <E> E waitNIOFuture(Future<E> future)
                   throws IOException
Throws:
IOException


Copyright © 2009 SUN Microsystems. All Rights Reserved.