Using the konspire server

Run the server from the command line by typing the following command (note that you need to be in the directory where the "konspire.jar" file is located).

java -cp konspire.jar konspire.server.Server

The -cp argument to java tells it to add the JAR file "konspire.jar" to the class path. The second argument ("konspire.server.Server") tells java to run the Server class in package konspire.server. Running the server this way (with no arguments after it) will bring up the following usage message:

usage:
Server port_number max_connect [new_chain]
examples:
     Server 5433 15  
     Server 5433 15 0        
     Server 5433 15 1

The server takes two required arguments and one optional argument. The first required argument specifies the port number on which the server will listen, and the second argument specifies the maximum number of clients that are allowed to be connected to the server at one time. The optional new_chain argument tells the server whether to start a new konspire network or not. If new_chain is 1, the server starts up as the first node in a new konspire network and doesn't try to connect to an existing network (other servers can then connect to this "first node" to form a konspire network). If new_chain is 0 or is not specified, the server starts up and tries to get a live server list from an existing konspire network. For most uses, new_chain should be left at the default value.

Thus, to start a server on port 5001 that will accept 100 client connections, type

java -cp konspire.jar konspire.server.Server 5001 100

If your server is connecting to the konspire network for the first time, it probably won't have a good list of servers to try connecting to. If this is the case (if connections to every server in the "servers.dat" file fail), the server will prompt the user for the address and port number of a known live server. After connecting to a live konspire network, the server will save the list of known servers into the file "servers.dat". From this point forward, the server should connect to the konspire network at startup without prompting the user for the address and port number of a known server.

About port numbers
All that's important about the port_number argument is that you don't specify a port number that's already being used by a network application running on your machine. For instance, if you're running a web server on your computer, it will likely be listening for connections on port 80. Thus, trying to run a konspire server on port 80 will fail (Java will throw a network exception). However, as long as you're not running a web server, port 80 will work fine. In general, it's a good idea to stay away from ports that are commonly used by other network servers. Ports in the 5000 range are usually safe. If your internet provider (or university) is giving you trouble over using file sharing applications (like konspire, Napster, or Gnutella), you could prevent them from detecting you by running a konspire server on port 80: they'll think you're just running a web server.

Firewalls
If you're behind a firewall, you'll need to talk to the firewall administrator so that a tunnel can be set up to your machine on whatever port your konspire server is running.

About the maximum connection limits
If your server is operating with a full load of clients and a new client tries to connect, the server will reject the new client connection. Before sending the rejection, however, the server will send the client a complete server list. Thus, even if the client cannot connect to your server, it will not be stranded: it can try making connections to other servers on the list.

About the file database kept by your server
As soon as your server connects to the konspire network, it begins receiving file lists from every new client that connects to the network (even if the clients connect to other servers). It does not get file lists from clients that are already connected to the network (unless they rescan their file lists or reconnect). Thus, right after your server starts up, it won't have a complete copy of the file database. However, after a certain amount of time passes, most clients will either reconnect or rescan their file list, so eventually your server will be almost completely up to date. Depending on how clients use the konspire network, the updating of your server's database may take anywhere from one hour to several days to complete.