next up previous
Next: serversocket Up: simsocket Previous: socketio

ClientSocket


     NAME
	  clientsocket - instantiated by Clients to act	as its socket

     DESCRIPTION
	  This subclass	of SocketIO is instantiated by a Client
	  program. It is in many ways similar to a Simula file object,
	  with Open, Endfile and Close operations.

     EXAMPLES
	  See the users	manual in simioprocess.ps

     AUTHOR
	  Boris	Magnusson, Lund	Institute of Technology.

     DETAILED INTERFACE
	     SocketIO class ClientSocket(Address);
	     ref(InterNetAddress) Address; ! Info on Server    to talk
	     to.;
	  Class	to use by a Client for communicating  over  a  Socket.
	  ClientSocket	objects	has an object of class InternetAddress
	  as a parameter rather	than a textual file-name.  The	`Open'
	  operation   is   implementing	  the  elaborate  sequence  of
	  operations needed to establish a connection with a a Server.
	  Using	 the  TCP/Stream  protocol  this  involves exchange of
	  several messages and a time-out in case the external	Server
	  does	not  respond. The time to perform an Open operation is
	  thus unpredictable. Operations for I/O are  those  described
	  in SocketIO.

	   Super: SocketBasics,	SocketIO
	   Kind: Concrete.
	   Init: the parameter must  denote  a	valid  InternetAddress
	  object.
	    Sequencing:	 (IsOpen  /  Open  (GetChannelNo/   <IO-ops>)*
	  Close)*;
	   : <IO-ops>=(OutRecord / InRecord / EndFile)*	 /
	   :	      (Read / Write / EndFile)*

     OPERATIONS
     Open
	     boolean procedure Open;
	  Open a Socket	communication link to the Server.  Wait	 until
	  the  Server  responds,  then return true. If the Server does
	  not respond (or maybe	does not exist)	Open will return False
	  after	 some  timeout	period.	 The parameters	to the object,
	  ServerInet, ServerPort are used to address the Server, and a
	  program executing on the Server to talk to.