Linux Socket Programming by Example by Warren Gay

By Warren Gay

Linux Socket Programming by way of instance starts with a truly easy advent to the basics of socket point programming. because the chapters growth, you're brought to comparable ideas, comparable to forming community addresses, Ipv6, the TCP/IP protocol suite and innovations, writing servers, and growing safe functions. additionally, you will know about socket basics, domain names and addresses, tackle conversion features, socket forms and protocols, net sockets, kinds and protocols, binding an deal with to a socket, utilizing Datagram orientated protocols, and masses extra.

Show description

Read or Download Linux Socket Programming by Example PDF

Best unix books

UNIX and Linux System Administration Handbook (4th Edition)

This publication methods approach management in a realistic method and is a useful reference for either new directors and skilled execs. It information top practices for each part of approach management, together with garage administration, community layout and management, e-mail, hosting, scripting, software program configuration administration, functionality research, home windows interoperability, virtualization, DNS, protection, administration of IT provider enterprises, and lots more and plenty extra.

Pulling Strings with Puppet: Configuration Management Made Easy

Efficient procedure directors comprehend their good fortune hinges upon with the ability to practice usually tedious initiatives with rigor and punctuality. Such metrics are usually completed basically by means of instituting a substantial measure of automation, whatever that has develop into much more the most important because it environments proceed to scale either when it comes to dimension and complexity.

Linux Journal (April 2016)

Linux magazine is the unique journal of the worldwide Linux group, supplying readers the recommendation and thought they should get the main out in their Linux platforms. In-depth details offers an entire 360-degree examine featured subject matters on the subject of Linux, giving a accomplished resource of every thing readers desire for growing and finishing their very own initiatives — not only instruments they are going to use this day, yet correct and encompassing details they'll flip to sooner or later.

Solaris 7 Administrator Certification Training Guide: Part I and Part II

For classes in Solaris, method management, and Certification: MCSE, MCSD, community, and different expert Certifications. Solaris is the quickest becoming and most well liked advertisement UNIX working process. scholars can exhibits their Solaris management abilities by way of making an attempt and attaining Solaris certification.

Extra resources for Linux Socket Programming by Example

Example text

Being able to reference files and sockets interchangeably by file unit number provides you with a great deal of flexibility. This also means that functions like read(2) and write(2) can operate upon both open files and sockets. Comparing Sockets to Pipes Before you are introduced to any socket functions, review the pipe(2) function call that you might already be familiar with. Let's see how the file descriptors it returns differ from a socket. h> int pipe(int filedes[2]); The pipe(2) function call returns two file descriptors when the call is successful.

5. The write(2) function is used to send the message from the client's socket to the server's socket in line 84. Errors are reported in lines 86 to 90. Page 32 6. The client at this point has no intention to send any more data to the server. The shutdown(2) function is called in line 97 to indicate this. Errors are reported in lines 98 to 101. 7. The client now calls read(2) to wait for a response message (line 106). The client process will wait indefinitely here until a response arrives. Errors are reported in lines 107 to 111.

It also demonstrated that the sockets are allocated to file unit numbers in the same manner that opened files are. The astute reader also might have noticed that this pair of AF_LOCAL sockets are also referred to as "unix" sockets (we saw this in the netstat(1) output). In fact, the C macro constant AF_UNIX could have been used in place of the macro AF_LOCAL for the domain value in the socketpair (2) function call. These values are equivalent, although standards efforts are now encouraging the use of AF_LOCAL over AF_UNIX.

Download PDF sample

Rated 4.21 of 5 – based on 5 votes