NOTES ON PROGRAMMING ASSIGNMENT 1:

Get these notes in text form

Get zipfile of testcode

When sending or receiving UDP or TCP packets, you need to allocate byte buffers to contain your sent or received message. We are using the convention of 1024 byte buffers as an upper limit. Make sure your buffers are at least that big for messasge reception. Also make sure you never send a packet that is bigger than 1024 bytes.

We have created a test stub to help you debug your program. The commandline is as follows:

  • java testStub -p1 [Listenning Port for Conn] -p2 [Listenning Port for ConnLess] -t [timerValue]

    You can use the same test stub to try out connectionless as well as connection oriented communication with your program. When your program initiates contact with the test stub, the stub will echo back your chat lines with a little bit of its own.

    The test stub will randomly choose between format 0 and format 1 for communication. Your program should be able to handle both seamlessly.

    When you initiate a chat session with a remote host, you can leave the Receiver field in the first chat message blank. Similarly, when the test stub initiates contact with you, the receiver field of the first message will be blank.

    To have the test stub initiate contact with your program. Have both programs running at once then use the ready utility as follows:

  • java ReadyConn -a [testStub IP address] -p [testStub listening port] -la [your program IP address] -lp [your program listening port]
  • java ReadyNoConn -a [testStub IP address] -p [testStub listening port] -la [your program IP address] -lp [your program listening port]

    Use ReadyNoConn to have the test stub initiate a connectionless chat session with your program, and ReadyConn otherwise.

    Your program is expected to be able to initiate a chat session with the test stub in both the connectionless and connection oriented modes. In addition, your program is expected to handle chat sessions initiated by the test stub(s) in either mode.

    Specifically, your program should handle the case when multiple instances of testStub talk to it simultaneously, either in connection-oriented or connectionless mode. And if there is anyproblem please post on coursework or email us.

    Good luck!