|
|||||||||
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.thrift.transport.TSocket
public class TSocket
Socket implementation of the TTransport interface. To be commented soon!
Field Summary |
---|
Fields inherited from class org.apache.thrift.transport.TIOStreamTransport |
---|
inputStream_, outputStream_ |
Constructor Summary | |
---|---|
TSocket(java.net.Socket socket)
Constructor that takes an already created socket. |
|
TSocket(java.lang.String host,
int port)
Creates a new unconnected socket that will connect to the given host on the given port. |
|
TSocket(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 TSocket(java.net.Socket socket) throws TTransportException
socket
- Already created socket object
TTransportException
- if there is an error setting up the streamspublic TSocket(java.lang.String host, int port)
host
- Remote hostport
- Remote portpublic TSocket(java.lang.String host, int port, int timeout)
host
- Remote hostport
- Remote porttimeout
- Socket timeoutMethod Detail |
---|
public void setTimeout(int timeout)
timeout
- Milliseconds timeoutpublic java.net.Socket getSocket()
public boolean isOpen()
isOpen
in class TIOStreamTransport
public void open() throws TTransportException
open
in class TIOStreamTransport
TTransportException
- if the transport could not be openedpublic void close()
close
in class TIOStreamTransport
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |