Class UDPTransport
- java.lang.Object
-
- com.biglybt.core.networkmanager.impl.TransportImpl
-
- com.biglybt.core.networkmanager.impl.udp.UDPTransport
-
- All Implemented Interfaces:
Transport
,TransportBase
public class UDPTransport extends TransportImpl
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.biglybt.core.networkmanager.Transport
Transport.ConnectListener
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
closed
private ProtocolEndpointUDP
endpoint
private static LogIDs
LOGID
private byte[][]
shared_secrets
private int
transport_mode
-
Fields inherited from interface com.biglybt.core.networkmanager.Transport
TRANSPORT_MODE_FAST, TRANSPORT_MODE_NORMAL, TRANSPORT_MODE_TURBO
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
UDPTransport(ProtocolEndpointUDP _endpoint, byte[][] _shared_secrets)
protected
UDPTransport(ProtocolEndpointUDP _endpoint, TransportHelperFilter _filter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close(java.lang.String reason)
Close the transport connection.void
connectOutbound(java.nio.ByteBuffer initial_data, Transport.ConnectListener listener, int priority)
Kick off an outbound connectionjava.lang.String
getDescription()
Get a textual description for this transport.int
getMssSize()
java.lang.String
getProtocol()
TransportEndpoint
getTransportEndpoint()
Get the socket channel used by the transport.int
getTransportMode()
Get the transport's speed mode.TransportStartpoint
getTransportStartpoint()
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, getUserData, isEncrypted, isReadyForRead, isReadyForWrite, read, readFailed, readyForRead, readyForWrite, setAlreadyRead, setFilter, setReadyForRead, setTrace, setUserData, unbindConnection, write, writeFailed
-
-
-
-
Field Detail
-
LOGID
private static final LogIDs LOGID
-
endpoint
private final ProtocolEndpointUDP endpoint
-
shared_secrets
private byte[][] shared_secrets
-
transport_mode
private int transport_mode
-
closed
private volatile boolean closed
-
-
Constructor Detail
-
UDPTransport
protected UDPTransport(ProtocolEndpointUDP _endpoint, byte[][] _shared_secrets)
-
UDPTransport
protected UDPTransport(ProtocolEndpointUDP _endpoint, TransportHelperFilter _filter)
-
-
Method Detail
-
isTCP
public boolean isTCP()
-
isSOCKS
public boolean isSOCKS()
- Specified by:
isSOCKS
in interfaceTransport
- Overrides:
isSOCKS
in classTransportImpl
-
getProtocol
public java.lang.String getProtocol()
- Specified by:
getProtocol
in interfaceTransport
- Overrides:
getProtocol
in classTransportImpl
-
getTransportEndpoint
public TransportEndpoint getTransportEndpoint()
Description copied from interface:Transport
Get the socket channel used by the transport.- Returns:
- the socket channel
-
getTransportStartpoint
public TransportStartpoint getTransportStartpoint()
- Specified by:
getTransportStartpoint
in interfaceTransport
- Overrides:
getTransportStartpoint
in classTransportImpl
-
getMssSize
public int getMssSize()
-
getDescription
public java.lang.String 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(java.nio.ByteBuffer initial_data, Transport.ConnectListener listener, int priority)
Description copied from interface:Transport
Kick off an outbound connection
-
close
public void close(java.lang.String reason)
Description copied from interface:Transport
Close the transport connection.
-
isClosed
public boolean isClosed()
-
-