ServerConnectionInterface
public class TCP_IP_ServerCommunication extends java.lang.Object implements ServerConnectionInterface
ServerConnectionInterface
.Modifier and Type | Field | Description |
---|---|---|
protected java.net.ServerSocket |
_socket |
Der Server-Socket des Datenverteilers
|
Constructor | Description |
---|---|
TCP_IP_ServerCommunication() |
Erzeugt eine Instanz dieser Klasse.
|
Modifier and Type | Method | Description |
---|---|---|
ConnectionInterface |
accept() |
Wartet auf eine Verbindungsanfrage eines Clients (passive Verbindung).
|
void |
connect(int subAdressNumber) |
Erstellt eine Verbindung zur lokalen Adresse mit der Nummer der Subadresse.
|
void |
disconnect() |
Schließt die aktuelle Verbindung.
|
ConnectionInterface |
getConnectionTo(java.net.Socket socket) |
|
ConnectionInterface |
getPlainConnection() |
Gibt eine Instanz der Kommunikationsklasse vom Typ
ConnectionInterface des gleichen Protokolls. |
java.lang.String |
getPlainConnectionName() |
Liefert den Klassennamen der Kommunikationsklasse vom Typ
ConnectionInterface des gleichen Protokolls. |
public TCP_IP_ServerCommunication()
public void connect(int subAdressNumber) throws CommunicationError
ServerConnectionInterface
connect
in interface ServerConnectionInterface
subAdressNumber
- die Nummer der SubadresseCommunicationError
- Wenn die Verbindung nicht erfolgreich erzeugt wurde.public void disconnect()
ServerConnectionInterface
disconnect
in interface ServerConnectionInterface
public ConnectionInterface accept()
ServerConnectionInterface
accept
in interface ServerConnectionInterface
null
, wenn keine Verbindung erzeugt werden konnte.public ConnectionInterface getPlainConnection()
ServerConnectionInterface
ConnectionInterface
des gleichen Protokolls.getPlainConnection
in interface ServerConnectionInterface
public ConnectionInterface getConnectionTo(java.net.Socket socket)
public java.lang.String getPlainConnectionName()
ServerConnectionInterface
ConnectionInterface
des gleichen Protokolls.getPlainConnectionName
in interface ServerConnectionInterface