[5288] in java-interest

home help back first fref pref prev next nref lref last post

No subject found in mail header

daemon@ATHENA.MIT.EDU (Leitheiser)
Mon Feb 5 10:32:41 1996

Date: Mon, 5 Feb 1996 08:02:50 -0600
From: jdleithe@ii1.mke.ab.com (Leitheiser)
To: java-interest@java.sun.com

Hi,
I'm new to java, but experienced in other OO languages.....
My first question deals with the interface java.io.DataOutput/Input
... in the writeUTF() method....where is the spec for what a UTF format is, and what is the % overhead for these higher level IO methods?. vs individual chars
at the stream level?

My second Question is with the following server and client code....(JDK-1.0 )
They both work well on Solaris, but running on win95 it locks up ( 96 client messages, 1 server message ). Is this a limitation/bug on win95, garbage collection, an error in the code?  

Thanks!
Jeff leitheiser
Rockwell Automation ( Allen-Bradley )

*******

 public void run() {
               // Create service on server
    ServerSocket s = null; 
    Socket s1 = null;

    int cnt = 0;
    int slength;
    OutputStream s1out;
    boolean soketReady = true;

    try {
      s = new ServerSocket(4321,300);
    } catch (IOException e) { 
               fStatus.setText( "error opening" );
               repaint();
               soketReady = false;

    }
               // Run the listen/accept loop forever
    while ( soketReady == true) {
         sendString.setLength( 0 );
     if( fWhat.getText() != "" ) {
       sendString.append( fWhat.getText() );
       try {
                               // Wait here and listen for a connection

                               fStatus.setText( "socket Ready! "+ cnt );
                               repaint();
                               s1=s.accept();
                               fStatus.setText( "socket found!" );
                               repaint();

                               // Get an output file handle associated with the socket
                               s1out = s1.getOutputStream();
                               // Send our string!
                               slength = sendString.length();
                               for (int i=0; i<slength; i++) {
                                       s1out.write((int)sendString.charAt(i));
                               }
                               // Close the connection, but not the server socket

                               cnt++;

                               s1.close();
       } catch (IOException e) { 
               fStatus.setText( "error running" );
               repaint();
       } // end fo try
      } else {
        System.out.print( "Empty String!\n" );
      } // end of empty string


    } // end of loop
  }
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post