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

com.barchart.udt.nio
Class NioSocketUDT

java.lang.Object
  extended by java.net.Socket
      extended by com.barchart.udt.net.NetSocketUDT
          extended by com.barchart.udt.nio.NioSocketUDT
All Implemented Interfaces:
IceCommon, IceSocket

public class NioSocketUDT
extends NetSocketUDT


Field Summary
protected  SocketChannelUDT channelUDT
           
 
Fields inherited from class com.barchart.udt.net.NetSocketUDT
inputStream, outputStream, socketUDT
 
Constructor Summary
protected NioSocketUDT(SocketChannelUDT channelUDT)
           
 
Method Summary
 SocketChannelUDT getChannel()
          Returns the unique SocketChannel object associated with this socket, if any.
 InputStream getInputStream()
          Returns an input stream for this socket.
 OutputStream getOutputStream()
          Returns an output stream for this socket.
 
Methods inherited from class com.barchart.udt.net.NetSocketUDT
bind, close, connect, connect, getInetAddress, getKeepAlive, getLocalAddress, getLocalPort, getLocalSocketAddress, getOOBInline, getPort, getReceiveBufferSize, getRemoteSocketAddress, getReuseAddress, getSendBufferSize, getSoLinger, getSoTimeout, getTcpNoDelay, getTrafficClass, isBound, isClosed, isConnected, isInputShutdown, isOutputShutdown, sendUrgentData, setKeepAlive, setOOBInline, setPerformancePreferences, setReceiveBufferSize, setReuseAddress, setSendBufferSize, setSoLinger, setSoTimeout, setTcpNoDelay, setTrafficClass, shutdownInput, shutdownOutput, socketUDT
 
Methods inherited from class java.net.Socket
setSocketImplFactory, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.barchart.udt.net.IceSocket
toString
 

Field Detail

channelUDT

protected final SocketChannelUDT channelUDT
Constructor Detail

NioSocketUDT

protected NioSocketUDT(SocketChannelUDT channelUDT)
                throws ExceptionUDT
Throws:
ExceptionUDT
Method Detail

getChannel

public SocketChannelUDT getChannel()
Description copied from interface: IceSocket
Returns the unique SocketChannel object associated with this socket, if any.

A socket will have a channel if, and only if, the channel itself was created via the SocketChannel.open or ServerSocketChannel.accept methods.

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

getInputStream

public InputStream getInputStream()
                           throws IOException
Description copied from interface: IceSocket
Returns an input stream for this socket.

If this socket has an associated channel then the resulting input stream delegates all of its operations to the channel. If the channel is in non-blocking mode then the input stream's read operations will throw an IllegalBlockingModeException.

Under abnormal conditions the underlying connection may be broken by the remote host or the network software (for example a connection reset in the case of TCP connections). When a broken connection is detected by the network software the following applies to the returned input stream :-

Closing the returned InputStream will close the associated socket.

Specified by:
getInputStream in interface IceSocket
Overrides:
getInputStream in class NetSocketUDT
Returns:
an input stream for reading bytes from this socket.
Throws:
IOException - if an I/O error occurs when creating the input stream, the socket is closed, the socket is not connected, or the socket input has been shutdown using IceSocket.shutdownInput() revised 1.4 spec JSR-51

getOutputStream

public OutputStream getOutputStream()
                             throws IOException
Description copied from interface: IceSocket
Returns an output stream for this socket.

If this socket has an associated channel then the resulting output stream delegates all of its operations to the channel. If the channel is in non-blocking mode then the output stream's write operations will throw an IllegalBlockingModeException.

Closing the returned OutputStream will close the associated socket.

Specified by:
getOutputStream in interface IceSocket
Overrides:
getOutputStream in class NetSocketUDT
Returns:
an output stream for writing bytes to this socket.
Throws:
IOException - if an I/O error occurs when creating the output stream or if the socket is not connected. revised 1.4 spec JSR-51

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

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