meta socket

Guus Sliepen guus at sliepen.warande.net
Sat Apr 22 15:39:01 CEST 2000


oi (ok now in english just in case),

How about using fdopen() on the meta socket, so you can use constructions
like this on the socket:

file=fdopen(fd,"r+");
...
fgets(buf,BUFSIZE,file);
sscanf(buf,"%bladiebla",&variables);

(fscanf seeks and that's not nice on sockets, so that's why this.)

This seems a lot easier to me than read() calls with the assumption that
every single read() contains only one request. And replies are a lot
easier to do this way too, just fprintf(file,"%bladiebla",variables).

Met vriendelijke groet,
Guus Sliepen.

---
TINC development list, tinc-devel at nl.linux.org
Archive: http://mail.nl.linux.org/tinc-devel/



More information about the Tinc-devel mailing list