MainComputersSoftwareOperating Systems › BSD Sockets: A Quick And Dirty Primer

BSD Sockets: A Quick And Dirty Primer

Edit Page
Report
Scan day: 07 February 2014 UTC
41
Virus safety - good
Description: Crash course in programming BSD sockets
For Unix Admins, By Unix Admins UGU: Unix Guru Universe - BSD Sockets: A Quick And Dirty Primer BSD Sockets: A Quick And Dirty Primer by Jim Frost February 13, 1990 As you delve into the mysteries of UNIX, you find more and more things that are difficult to understand immediately. One of these things, at least for most people, is the BSD socket concept. This is a short tutorial that explains what they are, how they work, and gives sample code showing how to use them. The Analogy (or: What *IS* a socket, anyway?) The socket is the BSD method for accomplishing interprocess communication (IPC). What this means is a socket is used to allow one process to speak to another, very much like the telephone is used to allow one person to speak to another. The telephone analogy is a very good one, and will be used repeatedly to describe socket behavior. Installing Your New Phone (or: How to listen for socket connections) In order for a person to receive telephone calls, he must first have a telephone installed. Likewise you must create a socket to listen for connections. This process involves several steps. First you must make a new socket, which is similar to having a telephone line installed. The socket() command is used to do this. Since sockets can have several types, you must specify what type of socket you want when you create one. One option that you have is the addressing format of a socket. Just as the mail service uses a different scheme to deliver mail than the telephone company uses to complete calls, so can sockets differ. The two most common addressing schemes are AF_UNIX and AF_INET. AF_UNIX addressing uses UNIX pathnames to identify sockets; these sockets are very useful for IPC between processes on the same machine. AF_INET addressing uses Internet addresses which are four byte numbers usually written as four decimal numbers separated by periods (such as 192.9.200.10). In addition to the machine address, there is also a port number which allows more than one AF_INET socket on each machine. AF_INET addresses
Size: 2048 chars

Contact Information

Email:
Phone&Fax:
Address:
Extended:

WEBSITE Info

Page title:UGU: Unix Guru Universe - BSD Sockets: A Quick And Dirty Primer
Keywords:Unix Guru Universe, Unix, Solaris, Linux, AIX, HPUX, Sun Microsystems, IBM, HP, Red Hat, Suse, Mandrake, Unix Flavors, BSD, FreeBSD, SCO, Windows
Description:
IP-address:64.34.252.80

WHOIS Info

NS
Name Server: DNS1.BECOTECH.COM
Name Server: DNS2.BECOTECH.COM
Name Server: NS1.BECOTECH.NET
Name Server: NS2.BECOTECH.NET
WHOIS
Status: clientTransferProhibited
Date
Creation Date: 30-nov-1995
Expiration Date: 29-nov-2015