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 Interfaces
ServerConnectionInterface.-
Field Summary
Fields Modifier and Type Field Description protected java.net.ServerSocket_socketDer Server-Socket des Datenverteilers -
Constructor Summary
Constructors Constructor Description TCP_IP_ServerCommunication()Erzeugt eine Instanz dieser Klasse. -
Method Summary
Modifier and Type Method Description ConnectionInterfaceaccept()Wartet auf eine Verbindungsanfrage eines Clients (passive Verbindung).voidconnect(int subAdressNumber)Erstellt eine Verbindung zur lokalen Adresse mit der Nummer der Subadresse.voiddisconnect()Schließt die aktuelle Verbindung.ConnectionInterfacegetConnectionTo(java.net.Socket socket)ConnectionInterfacegetPlainConnection()Gibt eine Instanz der Kommunikationsklasse vom TypConnectionInterfacedes gleichen Protokolls.java.lang.StringgetPlainConnectionName()Liefert den Klassennamen der Kommunikationsklasse vom TypConnectionInterfacedes gleichen Protokolls.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
_socket
protected java.net.ServerSocket _socketDer Server-Socket des Datenverteilers
-
-
Constructor Details
-
TCP_IP_ServerCommunication
public TCP_IP_ServerCommunication()Erzeugt eine Instanz dieser Klasse.
-
-
Method Details
-
connect
Description copied from interface:ServerConnectionInterfaceErstellt eine Verbindung zur lokalen Adresse mit der Nummer der Subadresse. Eine maximal erlaubte Anzahl an Verbindungen kann spezifiziert werden.- Specified by:
connectin interfaceServerConnectionInterface- Parameters:
subAdressNumber- die Nummer der Subadresse- Throws:
CommunicationError- Wenn die Verbindung nicht erfolgreich erzeugt wurde.
-
disconnect
public void disconnect()Description copied from interface:ServerConnectionInterfaceSchließt die aktuelle Verbindung.- Specified by:
disconnectin interfaceServerConnectionInterface
-
accept
Description copied from interface:ServerConnectionInterfaceWartet auf eine Verbindungsanfrage eines Clients (passive Verbindung). Wenn die Anfrage erfolgt, wird der Repräsentant einer Verbindung erzeugt und zurückgegeben.- Specified by:
acceptin interfaceServerConnectionInterface- Returns:
- Repräsentant einer Verbindung oder
null, wenn keine Verbindung erzeugt werden konnte.
-
getPlainConnection
Description copied from interface:ServerConnectionInterfaceGibt eine Instanz der Kommunikationsklasse vom TypConnectionInterfacedes gleichen Protokolls.- Specified by:
getPlainConnectionin interfaceServerConnectionInterface- Returns:
- eine Instanz der Kommunikationsklasse
-
getConnectionTo
-
getPlainConnectionName
public java.lang.String getPlainConnectionName()Description copied from interface:ServerConnectionInterfaceLiefert den Klassennamen der Kommunikationsklasse vom TypConnectionInterfacedes gleichen Protokolls.- Specified by:
getPlainConnectionNamein interfaceServerConnectionInterface- Returns:
- Klassenname der Kommunikationsklasse
-