com.msi.network.connection
Interface clientConnection

All Known Implementing Classes:
clientTCPConnection

public interface clientConnection

Defines the methods necessary to communicate as a client with a server via TCP or UDP (subclassed). Connections persist only so long as the client or the server maintains them. When either side closes the connection it will be dropped on the other end.

Version:
1.0
Author:
thompson@milestonesolutions.com

Method Summary
 void close()
          Shut down cleanly.
 java.lang.String getLine()
          Reads from the low level communications channel.
 int getServerPort()
          Provide the server port often used as ID.
 void putLine(java.lang.String ln)
          Sends a single line back to the client.
 

Method Detail

getLine

public java.lang.String getLine()
                         throws java.lang.Exception
Reads from the low level communications channel. This is provided for protocols and commands that may need multiple lines and it may not be used in cases (datagram) that are not connection-oriented.

Returns:
String sent from the server with EOL stripped.
Throws:
java.lang.Exception - if an error occurs

getServerPort

public int getServerPort()
Provide the server port often used as ID.

Returns:
integer port for this server.

putLine

public void putLine(java.lang.String ln)
Sends a single line back to the client. Since it is really a String, it may be formatted in any fashion allowed by Strings. EOL is not added.

Parameters:
ln - a String value

close

public void close()
Shut down cleanly.



Copyright © 2001-2002 MileStone Solutions, Inc. All Rights Reserved.