This program is designed to be used by server or MUD administrators when a MUD or MUSH is down for some reason, or has relocated. The program listens on specified ports and if someone attempts to connect, sends a message and then disconnects immediately. The message could be something like "server down, please try again later", or "this game has moved to xxx.yyy.zzz port 1234".
The program is written for Win32 (Windows 95 or Windows NT). It uses multiple threads (one per port, and briefly, one per connection) to easily monitor many ports, if necessary.
It can be installed as a service, if it is needed to be run for lengthy periods (eg. if a MUD has moved to a different server altogether). Services can only be used on Windows NT. If you need to have the program running constantly on Windows 95, place it in your Startup folder.
The program reads a configuration file: PORTINFO.CFG
This file must be in the same directory as the PORTINFO.EXE file.
Each line in PORTINFO.CFG specifies a port to be monitored. It consists of a port number, followed by a filename. The filename is the name of a file, whose contents are sent to anyone connecting on that port. Comments may be used, if they start with a # at the start of the line.
eg.
4201,mushdown.txt
4202,mushdown.txt
# the port below is for a MUD that has relocated
4203,mudrelocated.txt
You may have any number of ports monitored. Multiple ports may share the same file name, as shown in the example.
The files with the messages in them should be ordinary text files, they will be sent "as is". The contents of the files are loaded into memory when the program starts up. If you change the file contents, you will have to stop PORTINFO and restart it.
Once the program is running, the main thread is waiting on keyboard input. Just press <enter> and the program will wrap up and exit.
On Windows NT, you can install it as a service. This means it will automatically start up when the system is booted, even if no-one logs in. To do this, use a command prompt window, and type:
PORTINFO /INSTALL
PORTINFO /START
You can subsequently stop it, by typing:
PORTINFO /STOP
To remove the service, type:
PORTINFO /REMOVE
To see if it is running, type:
PORTINFO /STATUS
You can see a summary of commands by typing:
PORTINFO /HELP
If you are planning to run PORTINFO as a service, initially test it stand-alone, by typing:
PORTINFO /RUN
That way, any errors in the configuration file (port in use or whatever) will be displayed on the screen. If you get no errors, then go ahead and install it as a service, if that is what you want to do.
If running as a console application, PORTINFO displays a message for each attempted connection for a port, along with the date and time. The output will look like this:
Starting listening thread for port 4201...
Connect from: 127.0.0.1 - port 4201 at Wednesday, April 01, 1998, 2:09 PM
Connect from: 127.0.0.1 - port 4201 at Wednesday, April 01, 1998, 2:09 PM
Connect from: 127.0.0.1 - port 4201 at Wednesday, April 01, 1998, 2:09 PM
Connect from: 172.16.10.12 - port 4201 at Wednesday, April 01, 1998, 2:09 PM
Connect from: 172.16.10.12 - port 4201 at Wednesday, April 01, 1998, 2:09 PM
If running as a service, PORTINFO writes to a log file named PORTINFO.LOG. You can check that file periodically to see whether people have been attempting to connect.
Once you have the program running successfully, use Telnet (or your MUD client program) to connect to your PC, using the appropriate port number. You can connect to your own PC by connecting to 127.0.0.1
To download, click on the "downloads" button at the top of this page.
This program is supplied free of charge. It is copyright 1998 by Nick Gammon. Source code is available from the downloads area.
Comments to Gammon Software support
Page updated on Wednesday, 15 December 2004