- Complete the networking code to allow a client and server to open a socket between them.
- Verify that you can open a socket on the local host, then try it from a different machine.
- After you can connect, repurpose your forking server by allowing any number of concurrent connections from clients.
- Your client/server logic will be different than before (see below)
Server: (place this in a function)
- Listens for a string (use the buffer size),
- Reply with the rot13 of the string.
Client: (Place this in a function)
- Prompts the user for a string.
- Send the user input to the client.
- Read the modified string from the server
- prints the modified string
server_handshake and client_handshake will not look the same.
Remember that the server must:
- getaddrinfo() - once.
- socket() - once.
- bind() - once.
- listen() - once.
- accept() - MANY times.
As a result, the one-time use code goes in the server_setup, and the accept is placed in the server_handshake function.
The client places all of this code in the client_handshake
- getaddrinfo() - once.
- socket() - once.
- connect() - once.