public Serwer( int port ) {

        try {
            System.out.println( "Binding to port " + port + ", please wait  ..." );
            server = new ServerSocket( port );
            System.out.println( "Server started: " + server );
            System.out.println( "Waiting for a client ..." );
            socket = server.accept();
            System.out.println( "Client accepted: " + socket );
            open();

            boolean done = false;
            while ( !done ) {
                try {
                    String line = streamIn.readUTF();
                    System.out.println(line);
                    done = line.equals( ".bye" );
                } catch( IOException ioe ) {
                    done = true;
                }
            }
            close();
        } catch( IOException ioe ) {
            System.out.println( ioe );
        }
    }