public class UtpMultiplexer extends Object implements Runnable
UtpSocket instances on a single DatagramSocket and forwarding the packets to the sockets.| Constructor and Description |
|---|
UtpMultiplexer(TorrentClient torrentClient)
Creates a new multiplexer based on the given
torrentClient |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanUpSocket(UtpSocketImpl socket)
Frees up the connection id used by the given UtpSocket and stops the polling for timeouts.
|
int |
getReceiveBufferSize() |
boolean |
registerSocket(UtpSocketImpl socket)
Attempts to register the given socket.
|
void |
run() |
void |
send(DatagramPacket datagramPacket)
Sends the given datagram packet onto the socket.
|
void |
shutdown()
Closes the socket.
|
public UtpMultiplexer(TorrentClient torrentClient) throws ModuleBuildException
torrentClienttorrentClient - The torrent client containing the desired configuration.ModuleBuildException - When the datagram socket cannot be bound.public boolean registerSocket(UtpSocketImpl socket)
socket - The socket to register.true when the socket is registered. false when the connection id conflicts with an existing socket.public void cleanUpSocket(UtpSocketImpl socket)
socket - The socket to clean up.public void send(DatagramPacket datagramPacket) throws IOException
datagramPacket - The packet to send.IOException - When the sending fails.public int getReceiveBufferSize()
multiplexerSocket.public void shutdown()
Copyright © 2016. All rights reserved.