public class UtpSocketRegistry extends Object
| Constructor and Description |
|---|
UtpSocketRegistry(DatagramChannel channel) |
| Modifier and Type | Method and Description |
|---|---|
UtpSocket |
allocateSocket(Function<Short,UtpSocket> socketSupplier)
Takes a function which creates, and stores, a socket based on the allocated connection id.
|
UtpSocket |
createSocket(SocketAddress socketAddress,
UtpPacket synPacket) |
Collection<UtpSocket> |
getAllSockets() |
UtpSocket |
getSocket(short connectionId) |
void |
removeShutdownSockets()
Removes all shutdown sockets freeing up their allocated IDs.
|
public UtpSocketRegistry(DatagramChannel channel)
public UtpSocket getSocket(short connectionId)
public UtpSocket allocateSocket(Function<Short,UtpSocket> socketSupplier)
socketSupplier - The function which is capable of creating a socket.public UtpSocket createSocket(SocketAddress socketAddress, UtpPacket synPacket)
public Collection<UtpSocket> getAllSockets()
public void removeShutdownSockets()
Copyright © 2017. All rights reserved.