|
Client Actions |
Communicate with server |
|
|
try{
// Instantiate an output stream tied directly to the socket
DataOutputStream oStream = new DataOutputStream(sock.getOutputStream());
// write a string and an int to the output stream,
// i.e. transmit them to the server
oStream.writeUTF("Hello!");
oStream.writeInt(3);
oStream.flush(); //tell java to empty the stream right now (= send the information)
}
catch(IOException ioe) {
System.out.println("Write error: " + ioe.getMessage());
}
|
| See the "Links" link above to find out the sources of the proposed informations Pascal Vuylsteker / eScience / Computer Science / ANU |
Last modified: 22/3/2005
TOC - Print |
Send your comments at : <pvk@vuylsteker.net> |