Package org.apache.thrift.transport
Class TNonblockingSSLSocket
java.lang.Object
org.apache.thrift.transport.TTransport
org.apache.thrift.transport.TEndpointTransport
org.apache.thrift.transport.TNonblockingTransport
org.apache.thrift.transport.TNonblockingSocket
org.apache.thrift.transport.TNonblockingSSLSocket
- All Implemented Interfaces:
Closeable,AutoCloseable,SocketAddressProvider
Transport for use with async ssl client.
-
Field Summary
Fields inherited from class org.apache.thrift.transport.TEndpointTransport
knownMessageSize, remainingMessageSize -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTNonblockingSSLSocket(String host, int port, int timeout, SSLContext sslContext) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the socket.booleanNon-blocking connection completion.booleanisOpen()Checks whether the socket is connected.voidopen()Do not call, the implementation provides its own lazy non-blocking connect.intread(ByteBuffer buffer) Perform a nonblocking read into buffer.registerSelector(Selector selector, int interests) Register the new SocketChannel with our Selector, indicating we'd like to be notified when it's ready for I/O.booleanNon-blocking connection initialization.intwrite(ByteBuffer buffer) Perform a nonblocking write of the data in buffer;Methods inherited from class org.apache.thrift.transport.TNonblockingSocket
flush, getLocalSocketAddress, getRemoteSocketAddress, getSocketChannel, read, setTimeout, toString, writeMethods inherited from class org.apache.thrift.transport.TEndpointTransport
checkReadBytesAvailable, countConsumedMessageBytes, getConfiguration, getMaxFrameSize, getMaxMessageSize, resetConsumedMessageSize, setMaxFrameSize, setMaxMessageSize, updateKnownMessageSizeMethods inherited from class org.apache.thrift.transport.TTransport
consumeBuffer, getBuffer, getBufferPosition, getBytesRemainingInBuffer, peek, readAll, writeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.thrift.transport.SocketAddressProvider
getLocalSocketAddress, getRemoteSocketAddress
-
Constructor Details
-
TNonblockingSSLSocket
protected TNonblockingSSLSocket(String host, int port, int timeout, SSLContext sslContext) throws IOException, TTransportException - Throws:
IOExceptionTTransportException
-
-
Method Details
-
registerSelector
Register the new SocketChannel with our Selector, indicating we'd like to be notified when it's ready for I/O.- Overrides:
registerSelectorin classTNonblockingSocket- Returns:
- the selection key for this socket.
- Throws:
IOException
-
isOpen
public boolean isOpen()Checks whether the socket is connected.- Overrides:
isOpenin classTNonblockingSocket- Returns:
- True if the transport is open.
-
open
Do not call, the implementation provides its own lazy non-blocking connect.- Overrides:
openin classTNonblockingSocket- Throws:
TTransportException- if the transport could not be opened
-
read
Perform a nonblocking read into buffer.- Overrides:
readin classTNonblockingSocket- Parameters:
buffer- The buffer into which bytes are to be transferred- Returns:
- The number of bytes read, possibly zero, or -1 if the channel has reached end-of-stream
- Throws:
TTransportException- if there was an error reading data
-
write
Perform a nonblocking write of the data in buffer;- Overrides:
writein classTNonblockingSocket- Parameters:
buffer- The buffer from which bytes are to be retrieved- Returns:
- The number of bytes written, possibly zero
- Throws:
TTransportException- if there was an error writing data
-
close
public void close()Closes the socket.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classTNonblockingSocket
-
startConnect
Non-blocking connection initialization.- Overrides:
startConnectin classTNonblockingSocket- Throws:
IOException- See Also:
-
finishConnect
Non-blocking connection completion.- Overrides:
finishConnectin classTNonblockingSocket- Throws:
IOException- See Also:
-