Installation instructions for FMChat 2.1 - server component for Windows

Note: in order to have FMChat 2.1 on your site, you must also install FMChat 2.1 - client component

1. Read the file license.html. If you don't fully agree with it then you have no right to install this software. If you have any questions, contact me (florinm@topedge.com).

2. Before installing FMChat, you must understand how this chat system work:
FMChat has three components
:- the applet
- a cgi-bin (fmchatcln.exe)
- the server (fmchatsrv.exe)
The applet never discuss directly with the server. It just access the URL represented by the cgi-bin, by posting data and receiving results. So, the applet only uses http protocol and http port for communication. The cgi-bin receives requests from the applet, forward them to the server, receives results from the server and then forward the results to the applet. Communication between the cgi-bin and the server is done using TCP/IP sockets. For this, the server is listening on a reserved port (currently 7766).

3. Start the server, which has three parameters in the command line:
fmchatsrv.exe rcv_timeout ack_timeout log_file_path_name
example:
fmchatsrv.exe 200 100 c:\folder\subfolder\fmchat.log
The meaning of the parameters is:
a. rcv_timeout (receive timeout, in seconds): When a user connect himself to FMChat, it must be prepared to receive messages. For this it call the cgi-bin which in turn contact the server asking him something like "give me my message". The message might arrive in one second, one hour or it might not arrive at all. In order to avoid having a cgi-bin running forever, the fmchatcln cgi-bin will kill himself after rcv_timeout seconds, even if it doesn't have any message from the server to forward to the applet. Before killing himself, however, the fmchatcln will notify the applet so that the applet will call it again, this loop keeping as long as the user is connected. Forcing the fmchatcln to stop and restart after rcv_timeout seconds isn't only a recommended practice, it may be a required practice because some web servers have their own timeout after they kill a cgi-bin if it doesn't end. In this case, rcv_timeout must obviously be set to a value smaller than the web server's value.
A good choice for rcv_timeout might be 200.
b. ack_timeout (acknowledge timeout, in seconds): When communicating with a client, if the client response doesn't came in ack_timeout seconds, the server will consider that that client is no longer active and will discard it
If ack_timeout is too small, there's a danger for the server to disconnect a client only because the line was to slow, although the client is still alive.
If ack_timeout is too big, there's a danger for the server to not disconnect some clients even if the clients are no longer alive. For example, if a user ungracefully kill his chat applet without notifying the server and then restart the applet and try to reconnect using the same name, the server will reject this second attempt to connect because it doesn't know that the first connection is no longer alive. However, in such a case the server will recheck if the first connection is still alive and the applet will instruct the client to retry to connect after waiting ack_timeout seconds
A good choice for ack_timeout is 100 seconds.
c. log_file_path_name: full pathname for the log file. this file is opened in append mode each time when fmchatsrv.exe start. Be careful to give a valid name with appropriate access rights. The server report the errors in the log file, but if the log file himself can't be opened, this error will be reported nowhere.

4. Put the fmchatcln.exe file somewhere in the cgi-bin directory, thus making him available for the applet.
NOTE: Both fmchatsrv.exe and fmchatcln.exe require the file cygwin.dll, so cygwin.dll must be made accessible by putting it somewhere in the path or in the current folder.
A good idea is to keep all the three files (fmchatsrv.exe, fmchatcln.exe, cygwin.dll) in the same folder. These three files are the only needed for the server and cgi-bin component of the FMChat system.

6. That's all. It must work. If however it doesn't, please contact me. FMChat is simple and robust and it can't have unsolvable problems.

Thank you for using FMChat.