|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.thrift.transport.TTransport
org.apache.thrift.transport.TIOStreamTransport
org.apache.cassandra.thrift.TCustomSocket
public class TCustomSocket
Socket implementation of the TTransport interface. Adds socket buffering
| Field Summary |
|---|
| Fields inherited from class org.apache.thrift.transport.TIOStreamTransport |
|---|
inputStream_, outputStream_ |
| Constructor Summary | |
|---|---|
TCustomSocket(java.net.Socket socket)
Constructor that takes an already created socket. |
|
TCustomSocket(java.lang.String host,
int port)
Creates a new unconnected socket that will connect to the given host on the given port. |
|
TCustomSocket(java.lang.String host,
int port,
int timeout)
Creates a new unconnected socket that will connect to the given host on the given port. |
|
| Method Summary | |
|---|---|
void |
close()
Closes the socket. |
java.net.Socket |
getSocket()
Returns a reference to the underlying socket. |
boolean |
isOpen()
Checks whether the socket is connected. |
void |
open()
Connects the socket, creating a new socket object if necessary. |
void |
setTimeout(int timeout)
Sets the socket timeout |
| Methods inherited from class org.apache.thrift.transport.TIOStreamTransport |
|---|
flush, read, write |
| Methods inherited from class org.apache.thrift.transport.TTransport |
|---|
consumeBuffer, getBuffer, getBufferPosition, getBytesRemainingInBuffer, peek, readAll, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TCustomSocket(java.net.Socket socket)
throws org.apache.thrift.transport.TTransportException
socket - Already created socket object
org.apache.thrift.transport.TTransportException - if there is an error setting up the streams
public TCustomSocket(java.lang.String host,
int port)
host - Remote hostport - Remote port
public TCustomSocket(java.lang.String host,
int port,
int timeout)
host - Remote hostport - Remote porttimeout - Socket timeout| Method Detail |
|---|
public void setTimeout(int timeout)
timeout - Milliseconds timeoutpublic java.net.Socket getSocket()
public boolean isOpen()
isOpen in class org.apache.thrift.transport.TIOStreamTransport
public void open()
throws org.apache.thrift.transport.TTransportException
open in class org.apache.thrift.transport.TIOStreamTransportorg.apache.thrift.transport.TTransportExceptionpublic void close()
close in class org.apache.thrift.transport.TIOStreamTransport
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||