Run this code only on Linux based systems
To compile this, use following commands
gcc server.c -o server.out
or cc server.c -o server.out
Then to run it on a specified port, pass port as argument
./server.out 4000
To compile this, use following commands
gcc client.c -o client.out
or cc client.c -o client.out
Then to run it on a specified port, pass IP Address and port as argument
./client.out YOUR_IP_HERE 4000
Note: For testing on same PC, use localhost.
Note: Put test.txt file in client side
Run this code only on Windows based systems
To compile this, use the following commands
gcc TCPserver.c -o server -lws2_32
Then for running the code
./server.exe
the port is hardcoded as 55555 and the IP address is 127.0.0.1
To compile this, use following commands
gcc client.c -o client -lws2_32
Then for running the code
./client.exe
the port is hardcoded as 55555 and the IP address is 127.0.0.1