Specifications

Sun Services
Java™ Programming Language
Module 15, slide 12 of 12
Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. Sun Services, Revision F
Minimal TCP/IP Client
17
18 // Read the input and print it to the screen
19 System.out.println(dis.readUTF());
20
21 // When done, just close the steam and connection
22 dis.close();
23 s1.close();
24
25 } catch (ConnectException connExc) {
26 System.err.println("Could not connect.");
27
28 } catch (IOException e) {
29 // ignore
30 } // END of try-catch
31
32 } // END of main method
33
34 } // END of SimpleClient program