FileDocCategorySizeDatePackage
Transport.javaAPI DocAzureus 3.0.3.44326Mon Mar 05 14:57:18 GMT 2007com.aelitis.azureus.core.networkmanager

Transport

public interface Transport implements TransportBase
Represents a peer Transport connection (eg. a network socket).

Fields Summary
public static final int
TRANSPORT_MODE_NORMAL
public static final int
TRANSPORT_MODE_FAST
public static final int
TRANSPORT_MODE_TURBO
Constructors Summary
Methods Summary
public voidclose(java.lang.String reason)
Close the transport connection.

public voidconnectOutbound(java.nio.ByteBuffer initial_data, com.aelitis.azureus.core.networkmanager.Transport$ConnectListener listener)
Kick off an outbound connection

param
listener

public voidconnectedInbound()
Indicate that inbound connection is complete

public java.lang.StringgetEncryption()
Return a textual description of the encryption for this transport

return

public intgetMssSize()

public TransportEndpointgetTransportEndpoint()
Get the socket channel used by the transport.

return
the socket channel

public intgetTransportMode()
Get the transport's speed mode.

return
current mode

public booleanisEncrypted()

public longread(java.nio.ByteBuffer[] buffers, int array_offset, int length)
Read data from the transport into the given buffers. NOTE: Works like ScatteringByteChannel.

param
buffers into which bytes are to be placed
param
array_offset offset within the buffer array of the first buffer into which bytes are to be placed
param
length maximum number of buffers to be accessed
return
number of bytes read
throws
IOException on read error

public voidsetAlreadyRead(java.nio.ByteBuffer bytes_already_read)
Inject the given already-read data back into the read stream.

param
bytes_already_read data

public voidsetReadyForRead()
fake a wakeup so that a read cycle is attempted

public voidsetTrace(boolean on)

public voidsetTransportMode(int mode)
Set the transport to the given speed mode.

param
mode to change to

public longwrite(java.nio.ByteBuffer[] buffers, int array_offset, int length)
Write data to the transport from the given buffers. NOTE: Works like GatheringByteChannel.

param
buffers from which bytes are to be retrieved
param
array_offset offset within the buffer array of the first buffer from which bytes are to be retrieved
param
length maximum number of buffers to be accessed
return
number of bytes written
throws
IOException on write error