|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Transport
Represents a peer Transport connection (eg. a network socket).
Nested Class Summary | |
---|---|
static interface |
Transport.ConnectListener
Listener for notification of connection establishment. |
Field Summary | |
---|---|
static int |
TRANSPORT_MODE_FAST
|
static int |
TRANSPORT_MODE_NORMAL
|
static int |
TRANSPORT_MODE_TURBO
|
Method Summary | |
---|---|
void |
bindConnection(NetworkConnection connection)
|
void |
close(String reason)
Close the transport connection. |
void |
connectedInbound()
Indicate that inbound connection is complete |
void |
connectOutbound(ByteBuffer initial_data,
Transport.ConnectListener listener,
int priority)
Kick off an outbound connection |
String |
getEncryption(boolean verbose)
Return a textual description of the encryption for this transport |
int |
getMssSize()
|
String |
getProtocol()
|
TransportEndpoint |
getTransportEndpoint()
Get the socket channel used by the transport. |
int |
getTransportMode()
Get the transport's speed mode. |
TransportStartpoint |
getTransportStartpoint()
|
boolean |
isEncrypted()
|
boolean |
isSOCKS()
|
long |
read(ByteBuffer[] buffers,
int array_offset,
int length)
Read data from the transport into the given buffers. |
void |
setAlreadyRead(ByteBuffer bytes_already_read)
Inject the given already-read data back into the read stream. |
void |
setReadyForRead()
fake a wakeup so that a read cycle is attempted |
void |
setTrace(boolean on)
|
void |
setTransportMode(int mode)
Set the transport to the given speed mode. |
void |
unbindConnection(NetworkConnection connection)
|
long |
write(ByteBuffer[] buffers,
int array_offset,
int length)
Write data to the transport from the given buffers. |
Methods inherited from interface com.aelitis.azureus.core.networkmanager.TransportBase |
---|
getDescription, isReadyForRead, isReadyForWrite, isTCP |
Field Detail |
---|
static final int TRANSPORT_MODE_NORMAL
static final int TRANSPORT_MODE_FAST
static final int TRANSPORT_MODE_TURBO
Method Detail |
---|
int getMssSize()
void setAlreadyRead(ByteBuffer bytes_already_read)
bytes_already_read
- dataTransportStartpoint getTransportStartpoint()
TransportEndpoint getTransportEndpoint()
boolean isEncrypted()
String getEncryption(boolean verbose)
String getProtocol()
boolean isSOCKS()
void setReadyForRead()
long write(ByteBuffer[] buffers, int array_offset, int length) throws IOException
buffers
- from which bytes are to be retrievedarray_offset
- offset within the buffer array of the first buffer from which bytes are to be retrievedlength
- maximum number of buffers to be accessed
IOException
- on write errorlong read(ByteBuffer[] buffers, int array_offset, int length) throws IOException
buffers
- into which bytes are to be placedarray_offset
- offset within the buffer array of the first buffer into which bytes are to be placedlength
- maximum number of buffers to be accessed
IOException
- on read errorvoid setTransportMode(int mode)
mode
- to change toint getTransportMode()
void connectOutbound(ByteBuffer initial_data, Transport.ConnectListener listener, int priority)
listener
- void connectedInbound()
void close(String reason)
void bindConnection(NetworkConnection connection)
void unbindConnection(NetworkConnection connection)
void setTrace(boolean on)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |