Skip to content

C Socket Programming for Linux with a Server and Client Example Code

License

Notifications You must be signed in to change notification settings

smallbomb/-Linux-C-sample-socket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

-Linux-C-sample-socket

C Socket Programming for Linux with a Server and Client Example Code

1.Use setsockopt() to solve timeout problem.

2.Use signal() and waitpid() to solve zombie process beacuse of using fork().

Server:

Calculates the number to the power of two by the client sent

Client:

Send a number to server and receive a result from server

Command line

First step

~$ make clean ; make

Second step

~$ ./serversocket

From other terminal

~$ ./clientsocket 'num'

NOTE:

The 'num' have to decimal.