|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.caucho.server.connection.Connection
com.caucho.server.port.TcpConnection
public class TcpConnection
A protocol-independent TcpConnection. TcpConnection controls the TCP Socket and provides buffered streams.
Each TcpConnection has its own thread.
| Field Summary | |
|---|---|
boolean |
_isFree
|
| Fields inherited from class com.caucho.server.connection.Connection |
|---|
_controller |
| Method Summary | |
|---|---|
long |
beginActive()
Begins an active connection. |
void |
clearKeepalive()
Sets the keepalive state. |
void |
close()
|
protected void |
closeControllerImpl()
Closes the controller. |
void |
closeOnShutdown()
Closes on shutdown. |
protected java.lang.String |
dbgId()
|
void |
destroy()
Destroys the connection() |
void |
endActive()
Ends an active connection. |
long |
getAccessTime()
Returns the time the last Request began in milliseconds. |
int |
getId()
Returns the connection id. |
long |
getIdleTimeMax()
The idle time for a keepalive connection |
long |
getKeepaliveExpireTime()
Returns the keepalive expire time. |
long |
getKeepaliveStartTime()
Returns the keepalive start time |
java.net.InetAddress |
getLocalAddress()
Returns the local address of the socket. |
int |
getLocalPort()
Returns the socket's local TCP port. |
java.lang.String |
getName()
Returns the object name for jmx. |
Port |
getPort()
Returns the port which generated the connection. |
java.lang.Runnable |
getReadTask()
Returns the current read task |
java.net.InetAddress |
getRemoteAddress()
Returns the socket's remote address. |
int |
getRemoteAddress(byte[] buffer,
int offset,
int length)
Adds from the socket's remote address. |
java.lang.String |
getRemoteHost()
Returns the socket's remote host name. |
int |
getRemotePort()
Returns the socket's remote port |
ServerRequest |
getRequest()
Returns the request for the connection. |
long |
getRequestActiveTime()
Returns the time the current request has taken. |
long |
getRequestStartTime()
|
java.lang.Runnable |
getResumeTask()
Returns the current write task |
QSocket |
getSocket()
Returns the connection's socket |
java.lang.Exception |
getStartThread()
|
java.lang.String |
getState()
Returns the state string. |
long |
getSuspendTime()
Returns the time the comet suspend started |
long |
getThreadId()
Returns the thread id. |
java.lang.String |
getVirtualHost()
Returns the virtual host. |
void |
initSocket()
Initialize the socket for a new connection |
boolean |
isActive()
Returns true for active. |
boolean |
isClosed()
Returns true for closed. |
boolean |
isRequestActive()
Returns true for active. |
boolean |
isSecure()
Returns true if secure (ssl) |
void |
setAccessTime(long now)
Sets the time of the request start. |
void |
setController(ConnectionController controller)
Sets controller |
void |
setIdleTimeMax(long idleTime)
Sets the idle time for a keepalive connection. |
void |
setKeepalive()
Sets the keepalive state. |
void |
setRequest(ServerRequest request)
Sets the connection's request. |
void |
setStartThread()
|
void |
start()
Starts the connection. |
QSocket |
startSocket()
Returns the connection's socket |
boolean |
toKeepalive()
|
java.lang.String |
toString()
|
protected boolean |
wake()
Wakes the connection (comet-style). |
| Methods inherited from class com.caucho.server.connection.Connection |
|---|
getController, getReadStream, getWriteStream, sendBroadcast |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public boolean _isFree
| Method Detail |
|---|
public void setStartThread()
public java.lang.Exception getStartThread()
public void setAccessTime(long now)
now - the current time in milliseconds as by Alarm.getCurrentTime().public long getAccessTime()
public boolean isActive()
public boolean isRequestActive()
public int getId()
getId in class Connectionpublic boolean isClosed()
public void setIdleTimeMax(long idleTime)
public long getIdleTimeMax()
public void setKeepalive()
public void clearKeepalive()
public long getKeepaliveExpireTime()
public long getKeepaliveStartTime()
public java.lang.String getName()
public Port getPort()
public java.lang.Runnable getReadTask()
public java.lang.Runnable getResumeTask()
public final ServerRequest getRequest()
public final void setRequest(ServerRequest request)
public boolean isSecure()
Connection
isSecure in class Connectionpublic QSocket getSocket()
public long getSuspendTime()
public void initSocket()
throws java.io.IOException
java.io.IOExceptionpublic QSocket startSocket()
public java.net.InetAddress getLocalAddress()
getLocalAddress in class Connectionpublic int getLocalPort()
getLocalPort in class Connectionpublic java.net.InetAddress getRemoteAddress()
getRemoteAddress in class Connectionpublic java.lang.String getRemoteHost()
getRemoteHost in class Connection
public int getRemoteAddress(byte[] buffer,
int offset,
int length)
getRemoteAddress in class Connectionpublic int getRemotePort()
getRemotePort in class Connectionpublic final java.lang.String getState()
public java.lang.String getVirtualHost()
getVirtualHost in class Connectionpublic final long getThreadId()
public final long getRequestActiveTime()
public final long beginActive()
public final long getRequestStartTime()
public final void endActive()
public boolean toKeepalive()
public void start()
public void setController(ConnectionController controller)
setController in class Connectionprotected boolean wake()
wake in class Connectionpublic void closeOnShutdown()
public void close()
protected void closeControllerImpl()
closeControllerImpl in class Connectionpublic final void destroy()
protected java.lang.String dbgId()
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||