barchart-udt-core
2.3.0-SNAPSHOT / 2013-05-13T01:37:38.485-0500

com.barchart.udt.nio
Class NioServerSocketUDT

java.lang.Object
  extended by java.net.ServerSocket
      extended by com.barchart.udt.net.NetServerSocketUDT
          extended by com.barchart.udt.nio.NioServerSocketUDT
All Implemented Interfaces:
IceCommon, IceServerSocket

public class NioServerSocketUDT
extends NetServerSocketUDT


Field Summary
protected  ServerSocketChannelUDT channelUDT
           
 
Fields inherited from class com.barchart.udt.net.NetServerSocketUDT
socketUDT
 
Constructor Summary
protected NioServerSocketUDT(ServerSocketChannelUDT channelUDT)
           
 
Method Summary
 Socket accept()
          Listens for a connection to be made to this socket and accepts it.
 void bind(SocketAddress endpoint)
          Binds the ServerSocket to a specific address (IP address and port number).
 ServerSocketChannelUDT getChannel()
          Returns the unique ServerSocketChannel object associated with this socket, if any.
 
Methods inherited from class com.barchart.udt.net.NetServerSocketUDT
bind, close, getInetAddress, getLocalPort, getLocalSocketAddress, getReceiveBufferSize, getReuseAddress, getSoTimeout, isBound, isClosed, setPerformancePreferences, setReceiveBufferSize, setReuseAddress, setSoTimeout, socketUDT
 
Methods inherited from class java.net.ServerSocket
implAccept, setSocketFactory, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.barchart.udt.net.IceServerSocket
toString
 

Field Detail

channelUDT

protected final ServerSocketChannelUDT channelUDT
Constructor Detail

NioServerSocketUDT

protected NioServerSocketUDT(ServerSocketChannelUDT channelUDT)
                      throws IOException
Throws:
IOException
Method Detail

accept

public Socket accept()
              throws IOException
Description copied from interface: IceServerSocket
Listens for a connection to be made to this socket and accepts it. The method blocks until a connection is made.

A new Socket s is created and, if there is a security manager, the security manager's checkAccept method is called with s.getInetAddress().getHostAddress() and s.getPort() as its arguments to ensure the operation is allowed. This could result in a SecurityException.

Specified by:
accept in interface IceServerSocket
Overrides:
accept in class NetServerSocketUDT
Returns:
the new Socket
Throws:
IOException - if an I/O error occurs when waiting for a connection.
SocketTimeoutException - if a timeout was previously set with setSoTimeout and the timeout has been reached.
See Also:
revised 1.4 spec JSR-51

bind

public void bind(SocketAddress endpoint)
          throws IOException
Description copied from interface: IceServerSocket
Binds the ServerSocket to a specific address (IP address and port number).

If the address is null, then the system will pick up an ephemeral port and a valid local address to bind the socket.

Specified by:
bind in interface IceServerSocket
Overrides:
bind in class NetServerSocketUDT
Parameters:
endpoint - The IP address & port number to bind to.
Throws:
IOException - if the bind operation fails, or if the socket is already bound.

getChannel

public ServerSocketChannelUDT getChannel()
Description copied from interface: IceServerSocket
Returns the unique ServerSocketChannel object associated with this socket, if any.

A server socket will have a channel if, and only if, the channel itself was created via the ServerSocketChannel.open method.

Specified by:
getChannel in interface IceServerSocket
Overrides:
getChannel in class NetServerSocketUDT
Returns:
the server-socket channel associated with this socket, or null if this socket was not created for a channel

barchart-udt-core
2.3.0-SNAPSHOT / 2013-05-13T01:37:38.485-0500

Copyright © 2009-2013 Barchart, Inc.. All Rights Reserved.