Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a good book/guide for socket programming in C? [closed]

Tags:

c++

c

unix

sockets

Could anybody please tell me which is best guide/book/material for socket programming in C? I am reading beej's guide for network programming but it just gives an overview.
Can you suggest any other books or guides?

like image 308
Vijay Avatar asked Oct 20 '09 14:10

Vijay


People also ask

Can socket programming be done in C?

It extracts the first connection request on the queue of pending connections for the listening socket, sockfd, creates a new connected socket, and returns a new file descriptor referring to that socket. At this point, the connection is established between client and server, and they are ready to transfer data.

Is socket programming still used?

Most current network programming is done either using sockets directly, or using various other layers on top of sockets.

Which information is needed for socket programming?

The client in socket programming must know which information? Explanation: The client in socket programming must know IP address of Server as it has to use that IP address in order to initialize the socket class constructor. That is how the client requests a connection to the server.

Is socket programming hard?

Well, it is not hard but it requires experience and some googling. For example setting various time-outs or tricks how to prevent blocking calls. Primitive sockets are very simple but all calls are blocking and this will make user application unresponsive.


2 Answers

Start with UNIX Network Programming as Sinan Ünür said. Read TCP/IP Illustrated Volume 1 after you have decent grasp on sockets. Don't skip this since it will increase your knowledge of the various network protocols dramatically. FWIW, I think that these two books should form the foundation of anyone that even considers doing network programming at the socket layer.

like image 192
D.Shawley Avatar answered Sep 19 '22 13:09

D.Shawley


UNIX Network Programming, Volume 1, Second Edition: Networking APIs: Sockets and XTI.

Then go from there.

like image 22
Sinan Ünür Avatar answered Sep 18 '22 13:09

Sinan Ünür