Class UDPTransport
java.lang.Object
com.biglybt.core.networkmanager.impl.TransportImpl
com.biglybt.core.networkmanager.impl.udp.UDPTransport
- All Implemented Interfaces:
Transport
,TransportBase
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.biglybt.core.networkmanager.Transport
Transport.ConnectListener
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private final ProtocolEndpointUDP
private static final LogIDs
private byte[][]
private int
Fields inherited from interface com.biglybt.core.networkmanager.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_NORMAL, TRANSPORT_MODE_TURBO
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
UDPTransport
(ProtocolEndpointUDP _endpoint, byte[][] _shared_secrets) protected
UDPTransport
(ProtocolEndpointUDP _endpoint, TransportHelperFilter _filter) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Close the transport connection.void
connectOutbound
(ByteBuffer initial_data, Transport.ConnectListener listener, int priority) Kick off an outbound connectionGet a textual description for this transport.int
Get the socket channel used by the transport.int
Get the transport's speed mode.boolean
isClosed()
boolean
isSOCKS()
boolean
isTCP()
void
setTransportMode
(int mode) Set the transport to the given speed mode.Methods inherited from class com.biglybt.core.networkmanager.impl.TransportImpl
bindConnection, connectedInbound, connectedOutbound, getEncryption, getFilter, getPluginProxy, getUserData, isEncrypted, isReadyForRead, isReadyForWrite, read, readFailed, readyForRead, readyForWrite, setAlreadyRead, setFilter, setReadyForRead, setTrace, setUserData, unbindConnection, write, writeFailed
-
Field Details
-
LOGID
-
endpoint
-
transport_mode
private int transport_mode -
closed
private volatile boolean closed
-
-
Constructor Details
-
UDPTransport
-
UDPTransport
-
-
Method Details
-
isTCP
public boolean isTCP() -
isSOCKS
public boolean isSOCKS()- Specified by:
isSOCKS
in interfaceTransport
- Overrides:
isSOCKS
in classTransportImpl
-
getProtocol
- Specified by:
getProtocol
in interfaceTransport
- Overrides:
getProtocol
in classTransportImpl
-
getTransportEndpoint
Description copied from interface:Transport
Get the socket channel used by the transport.- Returns:
- the socket channel
-
getTransportStartpoint
- Specified by:
getTransportStartpoint
in interfaceTransport
- Overrides:
getTransportStartpoint
in classTransportImpl
-
getMssSize
public int getMssSize() -
getDescription
Description copied from interface:TransportBase
Get a textual description for this transport.- Returns:
- description
-
setTransportMode
public void setTransportMode(int mode) Description copied from interface:Transport
Set the transport to the given speed mode.- Parameters:
mode
- to change to
-
getTransportMode
public int getTransportMode()Description copied from interface:Transport
Get the transport's speed mode.- Returns:
- current mode
-
connectOutbound
public void connectOutbound(ByteBuffer initial_data, Transport.ConnectListener listener, int priority) Description copied from interface:Transport
Kick off an outbound connection- Parameters:
listener
-
-
close
Description copied from interface:Transport
Close the transport connection. -
isClosed
public boolean isClosed()
-