Class FishServer

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--FishServer
All Implemented Interfaces:
java.lang.Runnable

public class FishServer
extends java.lang.Thread

Server handles multiple client connections. The clients can then upload a list of shared files and search other users shared files for downloads. As default the server runs at port 47111, but if multiple instances of the server is used or another port is wished to be used, it can be specified as an commandline argument to the server: java Server [port number]

Version:
1.0
Author:
Björn Bertilsson

Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
FishServer(int port)
          Tries to open a ServerSocket on the requested port.
 
Method Summary
static void main(java.lang.String[] args)
          Static method that tries to start the Server on the default port if no other port is specified on the commandline.
 void run()
          Accepts incomming clients and gives them a ServerHandler and continues to accept new clients.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FishServer

public FishServer(int port)
Tries to open a ServerSocket on the requested port.

Parameters:
port - Portnumber to try to start the server on.
Method Detail

main

public static void main(java.lang.String[] args)
Static method that tries to start the Server on the default port if no other port is specified on the commandline. If the specified port isn't valid or is allready in use, the server will exit with an errormessage.

Parameters:
args - Contains userspecified commandline options.

run

public void run()
Accepts incomming clients and gives them a ServerHandler and continues to accept new clients.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread