Previous Inter-App Comm / The Orderly Shutdown Pattern Next

II. Java Language Networking Features

A. Sockets and ServerSockets

   // Server code
   java.net.ServerSocket server = new java.net.serversocket( 1789 );
   java.net.Socket client = server.accept(); // normally blocks

B. Addresses

   // Client code – localhost
   java.net.Socket client = new java.net.Socket( “localhost”, 1789 );

C. Streams

   // Client code
   OutputStream out = client.getOutputStream();
   out.write( . . . );
   out.flush(); // flush

Previous Inter-App Comm / The Orderly Shutdown Pattern Next

Copyright © 2018
iWay Technology Company
Boulder, Colorado USA
jt@iwaytechnology.com
A limited right to copy this page for
individual (non-commercial)
educational use only
is hereby granted.