Matura: Softwareentwicklung & Informationssysteme

3.1. Sockets

Allgemein

Properties

String propertiesFile, url, port;

try (BufferedInputStream bis = new BufferedInputStream(new FileInputStream(propertiesFile))) {
  Properties properties = new Properties();
  properties.load(bis);
  url = properties.getProperty("url");
  port = properties.getProperty("port");
}

ServerSocket

ClientSocket

Ablauf

Beispiel EchoServer (Bereits mit Multithreading am Server)