moockComm september 04, 2001 .client by colin moock...server by derek clayton. ---------------------------------------------------------------------------- contents of this file: filename version description -------- ------- ----------- * readme.txt 3 documentation * chatClient.fla 1.0.1 source of flash demo client * chatClient.swf compiled flash demo client * CommServer.java source of CommServer * CommServer.class 1.0.1 compiled CommServer * CSClient.java source of client thread * CSClient.class 1.0.2 compiled client thread class * CSTestClient.java source of java test client * CSTestClient.class 1.0.0 compiled java test client ---------------------------------------------------------------------------- ****************** *** CommServer *** ****************** A Generic Communications Relay Server in Java By Derek Clayton derek_clayton@iceinc.com Overview -------- CommServer is a communications relay server written in Java. When running it acts as a broadcast relay mechanism to connected clients...i.e., it accepts incoming messages from a client and then relays that message to all connected clients including the original producer. No processing is done on the message; it is relayed verbatim. CommServer does create one type of message. Whenever a client connects or disconnects a "n" message is broadcast where n is the new number of clients connected. Requirements ------------ CommServer is a persistent server. To use it the following requirements must be met by your host machine: 1) a free port above 1024 2) a JDK or JRE 1.0+ (see www.javasoft.com) installed and the java binary in your PATH 3) the ability to run java programs Contact your sys admin or isp host if you're not sure about these requirements. Installation ------------ CommServer consists of 2 files. CommServer.class and CSClient.class. 1) Place the class files in a directory on your host machine. 2) CD to that directory 3) Start the server with: "java CommServer [port]" where [port] = the port the server should listen to for incoming connections. Messages will be provided on success or failure. See your sys admin about running the server in the background or redirecting the messages to a log file. ******************** *** CSTestClient *** ******************** CSTestClient.class is a test client for testing your CommServer in isolation. Use it to check whether CommServer is running properly. To run CSTestClient, use: "java CSTestClient [ip] [port]" where [ip] = the ip of the machine CommServer is running on [port] = the port CommServer is running on Messages will be provided if the client can successfully connect to the server. If CSTestClient can connect to the server but your Flash client, for example, cannot then chances are your client is the source of some error. ******************************** *** disclaimer and copyright *** ******************************** the files provided in this package are provided as-is, without warranty. the authors assume no responsibility for any damages incurred by their use. all files may be used freely for both commercial and non-commercial purposes, but are copyright derek clayton and colin moock, and may not be redistributed or resold without the express permission of the authors. *********************************** *** commServer revision history *** *********************************** CommServer v1.0.1: Changed multibyte \u0000 termination character to single byte \0 (ASCII null). CSClient v1.0.2: Fixed a potential problem with the way streams were being closed. Now the in/out streams are closed BEFORE the socket to which they are associated is closed. *************************************** *** chatClient.fla revision history *** *************************************** chatClient v1.0.1: * Moved callback handler assignments to before connection attempt. onConnect() needs to be assigned before connect() is invoked. * Added error handling based on return value of connect().