|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrabbit.io.WebConnection
public class WebConnection
A class to handle a connection to the Internet.
| Constructor Summary | |
|---|---|
WebConnection(Address address,
SocketBinder binder,
Counter counter)
Create a new WebConnection to the given InetAddress and port. |
|
| Method Summary | |
|---|---|
void |
close()
|
void |
connect(NioHandler nioHandler,
WebConnectionListener wcl)
Try to establish the network connection. |
Address |
getAddress()
Get the address that this connection is connected to |
java.nio.channels.SocketChannel |
getChannel()
Get the actual SocketChannel that is used |
boolean |
getKeepalive()
Get the keepalive value of this WebConnection. |
long |
getReleasedAt()
Get the time that this WebConnection was released. |
boolean |
mayPipeline()
Check if this WebConnection may be used for pipelining. |
void |
setKeepalive(boolean b)
Set the keepalive value for this WebConnection, Can only be turned off. |
void |
setMayPipeline(boolean b)
Mark this WebConnection for pipelining. |
void |
setReleased()
Mark this WebConnection as released at current time. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public WebConnection(Address address,
SocketBinder binder,
Counter counter)
address - the computer to connect to.binder - the SocketBinder to use when creating the network socketcounter - the Counter to used to collect statistics| Method Detail |
|---|
public java.lang.String toString()
toString in class java.lang.Objectpublic Address getAddress()
public java.nio.channels.SocketChannel getChannel()
public void close()
throws java.io.IOException
close in interface java.io.Closeablejava.io.IOException
public void connect(NioHandler nioHandler,
WebConnectionListener wcl)
throws java.io.IOException
nioHandler - the NioHandler to use for network taskswcl - the listener that will be notified when the connection
has been extablished.
java.io.IOException - if the network operations failpublic void setKeepalive(boolean b)
b - the new keepalive value.public boolean getKeepalive()
public void setReleased()
public long getReleasedAt()
public void setMayPipeline(boolean b)
b - if true this connection may be used for pipelining.public boolean mayPipeline()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||