Skip to content

C Program to transfer file from one IP to another IP

Notifications You must be signed in to change notification settings

ncsrikar/clientserver

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C Client Server Code for Linux

Run this code only on Linux based systems


Server Code


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


Client Code


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



Client and Server code for Windows

Run this code only on Windows based systems


TCPserver


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

TCPclient


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

About

C Program to transfer file from one IP to another IP

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 100.0%