In this homework you are writing a server to accept connections from clients. You have been given the port numbers for your server and you should be able to respond to REQ requests appropriately. If the input is not one of these commands, you should send back an error message. All messages should be 63 bytes and below. Your server should operate in a loop for each accept and should continue accepting input from a client until it recieves a BYE. The server should be able to run indefinitely. 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. Send what you like but keep it under the character/byte requirement. "Other Commands here" You may allow your server to respond to other commands as you like. ------------------------ 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.