Class NioSocketUDT
- All Implemented Interfaces:
IceCommon,IceSocket,Closeable,AutoCloseable
-
Field Summary
FieldsFields inherited from class com.barchart.udt.net.NetSocketUDT
inputStream, outputStream, socketUDT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the uniqueSocketChannelobject associated with this socket, if any.Returns an input stream for this socket.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, socketUDTMethods inherited from class java.net.Socket
getOption, setOption, setSocketImplFactory, supportedOptions, toString
-
Field Details
-
channelUDT
-
-
Constructor Details
-
NioSocketUDT
- Throws:
ExceptionUDT
-
-
Method Details
-
getChannel
Description copied from interface:IceSocketReturns the uniqueSocketChannelobject associated with this socket, if any.A socket will have a channel if, and only if, the channel itself was created via the
SocketChannel.openorServerSocketChannel.acceptmethods.- Specified by:
getChannelin interfaceIceSocket- Overrides:
getChannelin classNetSocketUDT- Returns:
- the socket channel associated with this socket, or null if this socket was not created for a channel
-
getInputStream
Description copied from interface:IceSocketReturns 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 :-
-
The network software may discard bytes that are buffered by the socket. Bytes that aren't discarded by the network software can be read using
read. -
If there are no bytes buffered on the socket, or all buffered bytes have been consumed by
read, then all subsequent calls toreadwill throw anIOException. -
If there are no bytes buffered on the socket, and the socket has not been closed using
close, thenavailablewill return0.
Closing the returned
InputStreamwill close the associated socket.- Specified by:
getInputStreamin interfaceIceSocket- Overrides:
getInputStreamin classNetSocketUDT- 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 usingIceSocket.shutdownInput()revised 1.4 spec JSR-51
-
-
getOutputStream
Description copied from interface:IceSocketReturns 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
OutputStreamwill close the associated socket.- Specified by:
getOutputStreamin interfaceIceSocket- Overrides:
getOutputStreamin classNetSocketUDT- 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
-