Sockets (6)

3 Name: #!/usr/bin/anonymous : 2009-09-26 10:55 ID:Z9WVycSV

>>1
Then you have to delve into networking. Networking is supported in a different manner by different machines, programming languages, libraries, et cetera, but they all follow the same protocols of course.

So, the first question to ask OP, is this: For which operating system are you inetrested to have your code run? POSIX, which is the UNIX standard, provides a socket interface. WinAPI also has a socket interface (and by the way, WinAPI has almost copied the socket interface of POSIX, which is based on the original implementation on BSD, for which you may find the complete source code and documentation in TCP/IP Illustrated volume 2).

First thing you have to do is understand what is C and what is "extension" to C: C is the programming language defined by some standard and has nothing to do with networking, protocols, et cetera. What you get from POSIX is a library that you can use for these tasks. Also, don't forget that you'll have to learn both networking theory and the corresponding POSIX functions. Which should you do first? Well, luckily for you, there's an excellent book which is called UNIX network programming (http://www.kohala.com/start/unpv12e.html), which will introduce you to both at the same time.

There's still a problem though: You're learning only part of POSIX, which is the networking interface; it'll be good for you if you first got an idea for what POSIX is really about, so you can read another book first, called advanced programming in the unix environment (http://www.kohala.com/start/apue.html). This will teach you UNIX and POSIX. You'll learn how to handle all sorts of files and all their attributes (special devices, named or not pipes, files, user/group/other right, fcntl() et cetera). I guarantee to you >>1, that if you do take my advice you will be someone who has a very good understanding of unix, C, and networking at the same time.

>>2
That's just MEAN. You can't advice a newbie to look at that. If this suggestion is serious, you must be a complete newbie yourself (else you'd know how different is what OP is asking with what you gave him). If anyone is interested in having a more elaborated answer as to why >>2's suggestion is not good, I'll provide it, but there's no need to waste time if there's no demand.

This thread has been closed. You cannot post in this thread any longer.