what's the right way to send data between two program over a network.
like for example, when i want my client to make the display green, the server will send a command for it.
what's the right way to send that command?
i'm currently doing it like this:
sendCommandOverNetwork("turndisplay: green");
Read Stevens. "UNIX Network Programming,".
Even if you programming for shitty os like windows.
You'll programming network like you practiced it since Big Bang.
From ##C at freenode:
<talin> hmm, someone here told me that "beej's guide to socket programming" is very bad. any idea why?
<talin> i have the UNP book, and it's a great reference, but if i read it from cover to cover, my head will fill up with details, and then it'll dismiss everything
<Chris> talin: there's little point in reading it cover to cover, read the first few chapters plus selected later ones if/when you're interest in or need a particular piece
<Chris> beej likes to use obselescent/deprecated interfaces and assume that whatever happens on his computer defines POSIX and he doesn't know C very well either.
<talin> Chris: great. i have read until chapter 5 now... i think i will read the non-blocking part and perhaps about multicast once i find some use for it
<Chris> disclaimer: I've not looked at beej for a few years, it may've improved since but i doubt it :)
<PoppaVic> Chris: he's got a few new rewrites, supposedly heading toward a book. I dunno - they work if you use other references.
<talin> Chris: my biggest problem is that i rely so much on this unp.h header and the libraries written by this author... i wish he would guide me through the process from scratch like beej does
<Chris> talin: well, UNP assumes you know C already. If you know C, the unp.h stuff is a non-issue. Beej doesn't assume you know C, because _he_ doesn't know C :)
<Chris> talin: well, concentrate on understanding the fundamentals of C before you start playing with sockets.
<koosh> i think beej has a guide out for C as well
<Chris> koosh: yes, it's bad even by C web tutorial standards
<koosh> Chris: so beginners should just go ahead and skip to the standard itself?
<Chris> koosh: nope, just read a good book. the tutorials are mostly worse than nothing, because they are _wrong_ rather than just leaving things out
<sn6> When you think it can't get worse, Herbert Schildt comes along