Class NetworkConnectionImpl.bogusTransport
java.lang.Object
com.biglybt.core.networkmanager.impl.NetworkConnectionImpl.bogusTransport
- All Implemented Interfaces:
Transport, TransportBase
- Enclosing class:
NetworkConnectionImpl
-
Nested Class Summary
Nested classes/interfaces inherited from interface Transport
Transport.ConnectListener -
Field Summary
FieldsFields inherited from interface Transport
CR_BAD_PIECE_DATA, CR_DUPLICATE_PEER_ID, CR_INTERNAL_CONNECT_FAILED, CR_INVALID_INFO_HASH, CR_IP_BLOCKED, CR_NO_MEMORY, CR_NONE, CR_NOT_INTERESTED_UPLOAD_ONLY, CR_PEER_CHURN, CR_PORT_BLOCKED, CR_PROTOCOL_BLOCKED, CR_SELF_CONNECTION, CR_STOPPED_OR_REMOVED, CR_TIMEOUT, CR_TIMEOUT_ACTIVITY, CR_TIMEOUT_HANDSHAKE, CR_TIMEOUT_INTEREST, CR_TIMEOUT_REQUEST, CR_TOO_MANY_CONNECTIONS, CR_TOO_MANY_FILES, CR_UPLOAD_TO_UPLOAD, KEY_CLOSE_REASON, TRANSPORT_MODE_FAST, TRANSPORT_MODE_MEGA_TURBO, TRANSPORT_MODE_NORMAL, TRANSPORT_MODE_TURBO -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbindConnection(NetworkConnection connection) voidClose the transport connection.voidIndicate that inbound connection is completevoidconnectOutbound(ByteBuffer initial_data, Transport.ConnectListener listener, int priority) Kick off an outbound connectionGet a textual description for this transport.getEncryption(boolean verbose) Return a textual description of the encryption for this transportintGet the socket channel used by the transport.getUserData(Object key) booleanisClosed()booleanlongisReadyForRead(EventWaiter waiter) Is the transport ready to read, i.e.booleanisReadyForWrite(EventWaiter waiter) Is the transport ready to write, i.e.booleanisSOCKS()booleanisTCP()longread(ByteBuffer[] buffers, int array_offset, int length) Read data from the transport into the given buffers.voidsetAlreadyRead(ByteBuffer bytes_already_read) Inject the given already-read data back into the read stream.voidfake a wakeup so that a read cycle is attemptedvoidsetTrace(boolean on) voidsetTransportModes(int send_mode, int recv_mode) Set the transport to the given speed modes.voidsetUserData(Object key, Object value) voidunbindConnection(NetworkConnection connection) longwrite(ByteBuffer[] buffers, int array_offset, int length) Write data to the transport from the given buffers.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Transport
getTransportMode, setTransportMode
-
Field Details
-
transport
-
-
Constructor Details
-
bogusTransport
-
-
Method Details
-
isReadyForWrite
Description copied from interface:TransportBaseIs the transport ready to write, i.e. will a write request result in >0 bytes written.- Specified by:
isReadyForWritein interfaceTransportBase- Returns:
- true if the transport is write ready, false if not yet ready
-
isReadyForRead
Description copied from interface:TransportBaseIs the transport ready to read, i.e. will a read request result in >0 bytes read.- Specified by:
isReadyForReadin interfaceTransportBase- Returns:
- 0 if the transport is read ready, ms since last ready or created if never ready
-
isTCP
public boolean isTCP()- Specified by:
isTCPin interfaceTransportBase
-
isSOCKS
-
getPluginProxy
- Specified by:
getPluginProxyin interfaceTransport
-
getDescription
Description copied from interface:TransportBaseGet a textual description for this transport.- Specified by:
getDescriptionin interfaceTransportBase- Returns:
- description
-
getMssSize
public int getMssSize()- Specified by:
getMssSizein interfaceTransport
-
setAlreadyRead
Description copied from interface:TransportInject the given already-read data back into the read stream.- Specified by:
setAlreadyReadin interfaceTransport- Parameters:
bytes_already_read- data
-
getTransportEndpoint
Description copied from interface:TransportGet the socket channel used by the transport.- Specified by:
getTransportEndpointin interfaceTransport- Returns:
- the socket channel
-
getTransportStartpoint
- Specified by:
getTransportStartpointin interfaceTransport
-
isEncrypted
public boolean isEncrypted()- Specified by:
isEncryptedin interfaceTransport
-
getEncryption
Description copied from interface:TransportReturn a textual description of the encryption for this transport- Specified by:
getEncryptionin interfaceTransport- Returns:
-
getProtocol
- Specified by:
getProtocolin interfaceTransport
-
setReadyForRead
public void setReadyForRead()Description copied from interface:Transportfake a wakeup so that a read cycle is attempted- Specified by:
setReadyForReadin interfaceTransport
-
write
Description copied from interface:TransportWrite data to the transport from the given buffers. NOTE: Works like GatheringByteChannel.- Specified by:
writein interfaceTransport- Parameters:
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- Returns:
- number of bytes written
- Throws:
IOException- on write error
-
read
Description copied from interface:TransportRead data from the transport into the given buffers. NOTE: Works like ScatteringByteChannel.- Specified by:
readin interfaceTransport- Parameters:
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- Returns:
- number of bytes read
- Throws:
IOException- on read error
-
setTransportModes
public void setTransportModes(int send_mode, int recv_mode) Description copied from interface:TransportSet the transport to the given speed modes.- Specified by:
setTransportModesin interfaceTransport
-
connectOutbound
public void connectOutbound(ByteBuffer initial_data, Transport.ConnectListener listener, int priority) Description copied from interface:TransportKick off an outbound connection- Specified by:
connectOutboundin interfaceTransport- Parameters:
listener-
-
connectedInbound
public void connectedInbound()Description copied from interface:TransportIndicate that inbound connection is complete- Specified by:
connectedInboundin interfaceTransport
-
close
-
isClosed
-
bindConnection
- Specified by:
bindConnectionin interfaceTransport
-
unbindConnection
- Specified by:
unbindConnectionin interfaceTransport
-
getUserData
- Specified by:
getUserDatain interfaceTransport
-
setUserData
- Specified by:
setUserDatain interfaceTransport
-
setTrace
-