Class TCP_IP_ServerCommunication
- java.lang.Object
-
- de.bsvrz.dav.daf.communication.tcpCommunication.TCP_IP_ServerCommunication
-
- All Implemented Interfaces:
ServerConnectionInterface
public class TCP_IP_ServerCommunication extends java.lang.Object implements ServerConnectionInterface
TCP/IP-Implementierung des InterfacesServerConnectionInterface
.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.net.ServerSocket
_socket
Der Server-Socket des Datenverteilers
-
Constructor Summary
Constructors Constructor Description TCP_IP_ServerCommunication()
Erzeugt eine Instanz dieser Klasse.
-
Method Summary
All Methods Instance Methods Concrete Methods 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 TypConnectionInterface
des gleichen Protokolls.java.lang.String
getPlainConnectionName()
Liefert den Klassennamen der Kommunikationsklasse vom TypConnectionInterface
des gleichen Protokolls.
-
-
-
Method Detail
-
connect
public void connect(int subAdressNumber) throws CommunicationError
Description copied from interface:ServerConnectionInterface
Erstellt eine Verbindung zur lokalen Adresse mit der Nummer der Subadresse. Eine maximal erlaubte Anzahl an Verbindungen kann spezifiziert werden.- Specified by:
connect
in interfaceServerConnectionInterface
- Parameters:
subAdressNumber
- die Nummer der Subadresse- Throws:
CommunicationError
- Wenn die Verbindung nicht erfolgreich erzeugt wurde.
-
disconnect
public void disconnect()
Description copied from interface:ServerConnectionInterface
Schließt die aktuelle Verbindung.- Specified by:
disconnect
in interfaceServerConnectionInterface
-
accept
public ConnectionInterface accept()
Description copied from interface:ServerConnectionInterface
Wartet auf eine Verbindungsanfrage eines Clients (passive Verbindung). Wenn die Anfrage erfolgt, wird der Repräsentant einer Verbindung erzeugt und zurückgegeben.- Specified by:
accept
in interfaceServerConnectionInterface
- Returns:
- Repräsentant einer Verbindung oder
null
, wenn keine Verbindung erzeugt werden konnte.
-
getPlainConnection
public ConnectionInterface getPlainConnection()
Description copied from interface:ServerConnectionInterface
Gibt eine Instanz der Kommunikationsklasse vom TypConnectionInterface
des gleichen Protokolls.- Specified by:
getPlainConnection
in interfaceServerConnectionInterface
- Returns:
- eine Instanz der Kommunikationsklasse
-
getConnectionTo
public ConnectionInterface getConnectionTo(java.net.Socket socket)
-
getPlainConnectionName
public java.lang.String getPlainConnectionName()
Description copied from interface:ServerConnectionInterface
Liefert den Klassennamen der Kommunikationsklasse vom TypConnectionInterface
des gleichen Protokolls.- Specified by:
getPlainConnectionName
in interfaceServerConnectionInterface
- Returns:
- Klassenname der Kommunikationsklasse
-
-