Note: we will test your code with Java version 1.4.2 if written with Java, and gcc or g++ on linux or solaris if written in C/C++.


The jar file is here.
The server is started by entering the following at the command line:
java -jar HiRCServer.jar [port number] [password filename]

Note that this server is meant only to help you begin developing your clients. I make no promises that it is perfect or bug-free. Use your common sense if you sense that it does not act as expected or simply ask. Also, this server does not contain the extra functionality required for 449 students and 349 extra credit.


Below is some skeleton code to help you get started with your client.

public class HiRCClient extends Thread {

  HiRCClientUserInterface user_interface = null;

  public HiRCClient( String hostname, int port_number ) {

    // create GUI and pass "this" for callback
    user_interface = new HiRCClientUserInterface( this );

    // create thread for receiving server messages
    ( new Thread( this ) ).start( );

} // end HiRCClient( )

  public void processClientMessage( String message ) {

    // handle input from client

  } // end processClientMessage( )

  public void run( ) {

    // handle messages from server

  } // end run( )

  public static void main( String [] args ) {
    HiRCClient client = new HiRCClient( hostname, port_number );

  } // end main( )

} // end class HiRCClient


The class file is here.

See the above section to see how objects of this class are instantiated.

The user interface will pass strings captured from the keyboard to your instance of HiRCClient by calling the processClientMessage( String message ) method in your client (so, this method must be implemented in your client or you will have problems).

Additionally, you can print strings to the GUI by calling user_interface.displayText( message ) where message is a String object and user_interface is the instance of your HiRCClientUserInterface.

That's it!

Useful links

The following are very useful for Java Programmers:
Java API
Java Almanac

For those bold enough to attempt this in C/C++, I recommend the Unix Network Programming book by Stevens.