public class BlaubotEthernetUtils
extends java.lang.Object
Constructor and Description |
---|
BlaubotEthernetUtils() |
Modifier and Type | Method and Description |
---|---|
static BlaubotEthernetConnection |
getEthernetConnectionFromSocket(java.net.Socket clientSocket)
Creates a
BlaubotEthernetConnection from an incoming Socket . |
static void |
sendOwnUniqueIdThroughSocket(IBlaubotDevice ownDevice,
java.net.Socket clientSocket)
Send the unique id of ownDevice through the socket.
|
public static BlaubotEthernetConnection getEthernetConnectionFromSocket(java.net.Socket clientSocket)
BlaubotEthernetConnection
from an incoming Socket
.
Receives the uniqueId from the socket and creates the blaubot device as well as the
connection object.
// TODO: check if we can generalize the uniqueId transmission through a DataInputStreamclientSocket
- the connected socketIOException
occured on reading the unique id - NOTE that the clientSocket will be closed if the result is nullpublic static void sendOwnUniqueIdThroughSocket(IBlaubotDevice ownDevice, java.net.Socket clientSocket) throws java.io.IOException
ownDevice
- the device of which the uniqueDevice should be send - usually the ownDeviceclientSocket
- the connected socketjava.io.IOException
- if something went wrong with the socket communication