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: DxServer.java,v 1.1 2001/12/18 10:31:30 per_nyfelt Exp $
08:
09: package org.ozoneDB.DxLib.net;
10:
11: import org.ozoneDB.DxLib.*;
12: import java.net.*;
13: import java.io.*;
14:
15: /**
16: * DxServer ist eine einfache Socketverbindung an einem speziellen Port, an
17: * welche DxCompatible's gesendet bzw. empfangen werden können.
18: *
19: *
20: * @author <a href="http://www.softwarebuero.de/">SMB</a>
21: * @version $Revision: 1.1 $Date: 2001/12/18 10:31:30 $
22: */
23: public class DxServer extends DxClient {
24: ServerSocket server;
25:
26: public DxServer(int port) throws IOException {
27: server = new ServerSocket(port);
28: }
29:
30: public void accept() throws IOException {
31: sock = server.accept();
32:
33: out = new ObjectOutputStream(new BufferedOutputStream(sock
34: .getOutputStream()));
35: out.flush();
36: in = new ObjectInputStream(new BufferedInputStream(sock
37: .getInputStream()));
38: }
39:
40: public void close() throws IOException {
41: super.close();
42: server.close();
43: }
44: }
|