Skip to content
/ socket Public

A series of examples of TCP, UDP and XDR connections

License

Notifications You must be signed in to change notification settings

J4NN0/socket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Socket

A series of examples of TCP, UDP and XDR connections.

TCP

An example with a client and server using TCP connections.

The client connects to a server, send a message and terminate.

TCP select

An example with a client and server using TCP connections in which client wait server response for a while.

Function select() allows you to wait the answer (i.e coming from the sever) for a fixed time; if the answer didn't arrived in that time the program will go on.

TCP pre-forking

An example with a client and server using TCP connections in which server satisfy client request through child process generated before accepting connection.

A varibale is defined to manage the maximum number of child process that have to be generated, then every time a connection is accepted one of these process will satisfy the request of the client.

TCP concurrency

An example with a client and server using TCP connections in which server satisfy client request through child process generated each time a connection is accepted.

Every time a connection is accepted a child process is generated and will satisfy the request of the client. When the proces ends a SIGCHLD is triggered and through a signal handler the zombie proces will be captured.

UDP

An example with a client and server using UDP connections.

The client connects to a server, send a message and terminate.

XDR

An example with a client and server using XDR protocol.