In this homework you are writing a client to connect to a server. For now, the client will be connecting on the localhost to a server running on the local host (denoated as the ip address 127.0.0.1). The server will be running on port 35000. Application protocol: The client sends one of the following messages and the server responds. This is a question and answer type protocol in which the client is asking questions and the server simply responds. The following are valid messages to the server: "REQ" By sending REQ, the client is asking for an ip address and a port in the format xx.xx.xx.xx:yyy Where xx can be any number (although in ascii) from 0-255 and yyy can be any valid port number. "BYE" By sending BYE, the client is deliberating telling the server to shutdown the connection. The server will no longer listen to this client after it hears a BYE. "SEC" By sending SEC, the client is asking the server to send it some secret information. This secret information is actually a riddle (of sorts). Solving the riddle actually gives a 4th possible valid message to the server. Sending that 4th message will reward you with a 4th possible response. "..." The SEC will teach you another possible command. ------------------------ Some hints to help you do things a little easier. Most system code is stuck in the c-style method of handling strings for efficiency reasons. Thus, you should get handy with character arrays. You can make a character buffer array using: char buf[128]; You can convert a character array into a string using: string msg = buf; You can convert a string into a c_string for purposes of passing it to a send function using: msg.c_str(); Often, you'll be using a variable like buf above in a recv command. Before using it, it is useful to zero it out. You can do this with: bzero(buf,128); When you do a recv call on this buf, pass 127 instead of 128. This allows the last byte/character to be 0 or the null character which is a proper terminator for cstrings. There's another link on the website that demonstrates two ways to push variables into cstrings or strings as well.