01: // You can redistribute this software and/or modify it under the terms of
02: // the Ozone Library License version 1 published by ozone-db.org.
03: //
04: // The original code and portions created by SMB are
05: // Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.
06: //
07: // $Id: Acceptor.java,v 1.1 2001/12/18 10:31:30 per_nyfelt Exp $
08:
09: package org.ozoneDB.DxLib.net;
10:
11: import java.net.*;
12:
13: /**
14: * Thread, der staendig am entsprechenden port lauscht und eine neue Verbindung
15: * zum Server meldet.
16: */
17: class Acceptor implements Runnable {
18:
19: protected DxMultiServer server;
20:
21: protected Acceptor(DxMultiServer _server) {
22: server = _server;
23: }
24:
25: public void run() {
26: try {
27: while (true) {
28: DxMultiServerClient client = server
29: .newClient(server.serverSocket.accept());
30: if (client != null) {
31: server.add(client);
32: client.listen();
33: }
34: }
35: } catch (Exception e) {
36: }
37: }
38: }
|