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

com.barchart.udt.nio
Class ServerSocketChannelUDT

java.lang.Object
  extended by java.nio.channels.spi.AbstractInterruptibleChannel
      extended by java.nio.channels.SelectableChannel
          extended by java.nio.channels.spi.AbstractSelectableChannel
              extended by java.nio.channels.ServerSocketChannel
                  extended by com.barchart.udt.nio.ServerSocketChannelUDT
All Implemented Interfaces:
ChannelUDT, Closeable, Channel, InterruptibleChannel

public class ServerSocketChannelUDT
extends ServerSocketChannel
implements ChannelUDT

ServerSocketChannel-like wrapper for SocketUDT can be either stream or message oriented, depending on TypeUDT

you must use SelectorProviderUDT.openServerSocketChannel() to obtain instance of this class; do not use JDK ServerSocketChannel.open();

example:

 SelectorProvider provider = SelectorProviderUDT.DATAGRAM;
 ServerSocketChannel acceptChannel = provider.openServerSocketChannel();
 ServerSocket acceptSocket = acceptChannel.socket();
 InetSocketAddress acceptAddress = new InetSocketAddress("localhost", 12345);
 acceptorSocket.bind(acceptAddress);
 assert acceptSocket.isBound();
 SocketChannel connectChannel = acceptChannel.accept();
 assert connectChannel.isConnected();
 


Field Summary
protected static org.slf4j.Logger log
           
protected  NioServerSocketUDT socketAdapter
           
protected  SocketUDT socketUDT
           
 
Constructor Summary
protected ServerSocketChannelUDT(SelectorProviderUDT provider, SocketUDT socketUDT)
           
 
Method Summary
 SocketChannelUDT accept()
           
protected  void implCloseSelectableChannel()
           
protected  void implConfigureBlocking(boolean block)
           
 boolean isConnectFinished()
          Was connection request SocketChannelUDT.connect(java.net.SocketAddress) acknowledged by SocketChannelUDT.finishConnect()?
 KindUDT kindUDT()
          The kind of UDT channel.
 SelectorProviderUDT providerUDT()
          UDT specific provider which produced this channel.
 NioServerSocketUDT socket()
           
 SocketUDT socketUDT()
          Underlying UDT socket.
 String toString()
           
 TypeUDT typeUDT()
          The type of UDT socket.
 
Methods inherited from class java.nio.channels.ServerSocketChannel
open, validOps
 
Methods inherited from class java.nio.channels.spi.AbstractSelectableChannel
blockingLock, configureBlocking, implCloseChannel, isBlocking, isRegistered, keyFor, provider, register
 
Methods inherited from class java.nio.channels.SelectableChannel
register
 
Methods inherited from class java.nio.channels.spi.AbstractInterruptibleChannel
begin, close, end, isOpen
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.barchart.udt.nio.ChannelUDT
validOps
 
Methods inherited from interface java.nio.channels.Channel
close, isOpen
 

Field Detail

log

protected static final org.slf4j.Logger log

socketAdapter

@ThreadSafe(value="this")
protected NioServerSocketUDT socketAdapter

socketUDT

protected final SocketUDT socketUDT
Constructor Detail

ServerSocketChannelUDT

protected ServerSocketChannelUDT(SelectorProviderUDT provider,
                                 SocketUDT socketUDT)
Method Detail

accept

public SocketChannelUDT accept()
                        throws IOException
Specified by:
accept in class ServerSocketChannel
Throws:
IOException

implCloseSelectableChannel

protected void implCloseSelectableChannel()
                                   throws IOException
Specified by:
implCloseSelectableChannel in class AbstractSelectableChannel
Throws:
IOException

implConfigureBlocking

protected void implConfigureBlocking(boolean block)
                              throws IOException
Specified by:
implConfigureBlocking in class AbstractSelectableChannel
Throws:
IOException

isConnectFinished

public boolean isConnectFinished()
Description copied from interface: ChannelUDT
Was connection request SocketChannelUDT.connect(java.net.SocketAddress) acknowledged by SocketChannelUDT.finishConnect()?

Specified by:
isConnectFinished in interface ChannelUDT

kindUDT

public KindUDT kindUDT()
Description copied from interface: ChannelUDT
The kind of UDT channel.

Specified by:
kindUDT in interface ChannelUDT

providerUDT

public SelectorProviderUDT providerUDT()
Description copied from interface: ChannelUDT
UDT specific provider which produced this channel.

Specified by:
providerUDT in interface ChannelUDT

socket

public NioServerSocketUDT socket()
Specified by:
socket in class ServerSocketChannel

socketUDT

public SocketUDT socketUDT()
Description copied from interface: ChannelUDT
Underlying UDT socket.

Specified by:
socketUDT in interface ChannelUDT

toString

public String toString()
Overrides:
toString in class Object

typeUDT

public TypeUDT typeUDT()
Description copied from interface: ChannelUDT
The type of UDT socket.

Specified by:
typeUDT in interface ChannelUDT

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

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