Site icon Tutor Bin

C Networking Program Project

C Networking Program Project

Description

Write a program in C that optionally accepts an address and a port from the command line.

If there is no address/port on the command line, it should create a TCP socket and print the address (server mode).

If there is an address/port, it should connect to it (client mode). Once the connections are set up, each side should enter a loop of receive, print what it received, then send a message. The message should be “ping” from the client and “pong” from the server.

All functionality should be in the same .c file.

Hints:

  • You will need to pick a port for the server – something over 1024.
  • Ensure that you open your firewall to let the signal through.
  • Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."

    Exit mobile version