network programming - What more socket APIs are available? What are the differences between each of these Socket API? -


everyone referred socket programming or network programming in c , started using using including sys/socket.h & netinet/in.h. thought 100% true. question raised in mind when saw book

internetworking tcp/ip volume iii: client-server programming , applications, available in 4 different versions

  1. linux/posix sockets
  2. at&t tli (transport layer interface) sockets
  3. bsd (berkeley) sockets
  4. window sockets

i'm confused. shows there no standard socket api.

also i'm surprised see sys/socket.h & netinet/in.h part of posix c library in http://en.wikipedia.org/wiki/berkeley_sockets . i'm more confused now.

  1. why isn't there standard this?
  2. what more socket apis available?
  3. what differences between each of these socket api?
  4. when people "network programming in c" / "socket programming" referring to?
  5. links further information?

why isn't there standard this?

the de facto standard bsd sockets, upon linux, posix , windows sockets apis based.

what more socket apis available?

nothing that's still used. before bsd sockets , derivatives took on world, there many. of ones remain in embedded world, , going away mainstream oses continue swallow more , more of embedded market.

this battle pretty fought , on mid 90's. bsd sockets won.

what differences between each of these socket api?

there minor differences among bsd, linux , posix variants, nothing more serious other differences among unixy operating systems.

the reason have linux/posix version of book has more marketing technical. answers question publisher saw lot, "why need bsd book, i'm running linux, not bsd!" or, more commonly these days: "what's bsd?"

from 10,000 foot view, winsock different bsd sockets, because it's strict superset of bsd sockets, can still move knowledge over. of differences pure extensions bsd sockets, differences in windows kernel architecture , way windows programs typically built. instance, first big extension asynchronous sockets, makes easier use sockets in single-threaded windows gui program using pure bsd sockets. later extensions support special features available in nt derived kernels have no simple analog in unixy systems, event objects , overlapped i/o.

for it's worth, there extensions plain old bsd sockets in unixy systems, too, aio_*() stuff in solaris , other systems.

if program has source compatible many systems, either ignore these differences , program common base shared these systems, or build kind of translation layer lets use platform features transparently. apache latter instance, making use of fastest networking features on each platform, while core web server code doesn't care how networking gets done. many other programs choose portable path, since they're not performance critical, , saving programmer time therefore more important.

when people "network programming in c" / "socket programming" referring to?

bsd sockets or variant.

links further information?

the winsock programmer's faq. specifically, might want @ resources section, , faq article bsd sockets compatibility.

(disclaimer: i'm faq's maintainer.)


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -