Hi, folks. Here is the partial spec of my first networking programming assignment.
GET: This message is sent from the client to the server, and contains the ASCII string GET followed by the newline character \n. On sending the GET message, the client waits for a return message from the server via the socket that connects them.
eg.
Client: GET
Server: GET: OK
A dog says woof
however, what i've got from the command line is like this:
Server: GET: OK
you see, the rest of the message(after the newline character) is missing. Could someone plz point me out what i did wrong. Thanx in advance.
below is the complete four classes i've come up so far and the text file(animalSoundData.txt) the server reads. it's all complied. please copy it to your own HDD and run it so you would know exactly what the problem is. thanx again!
P.S. i am sorry about the long post. please bear with me as i am desperately looking for the solution.
the server class
the client class
the protocol class
the helper class
the content of text(animalSoundData.txt)file:
dog:woof
cat:miao
cow:moo
snake:hiss
bird:chirp
[ April 12, 2004: Message edited by: ambrositti li ]