Package org.jcsp.net2

Class NetAltingConnectionClient

    • Method Detail

      • request

        public void request​(Object obj)
                     throws IllegalStateException,
                            JCSPNetworkException
        Description copied from interface: ConnectionClient

        This method is used to send data to a ConnectionServer in a client/server conversation. If a connection has not yet been established, then this method will open the connection as necessary.

        Once this method has returned, the client may do some computation but must then guarantee to call reply(). This will obtain a server's response to the request. In between calling this method and reply(), doing pure computation is safe. Performing synchronization with other process is potentially hazardous.

        Once a server replies, if the connection has been kept open, then this method should be called again to make a further request.

        Programs using Connections need to adopt a protocol so that the server knows when a conversation with a client has finished and will then drop the connection.

        Specified by:
        request in interface ConnectionClient
        Parameters:
        obj - the Object to send to the server.
        Throws:
        IllegalStateException - if the method is called when it is not meant to be.
        JCSPNetworkException
      • destroy

        public void destroy()
        Description copied from interface: Networked
        Destroys the Networked construct
        Specified by:
        destroy in interface Networked
      • getLocation

        public NetLocation getLocation()
        Description copied from interface: Networked
        Gets the networked location of the Networked construct
        Specified by:
        getLocation in interface Networked
        Returns:
        The location of the construct