China Blue Veins
3/25/2011 3:03:00 PM
In article <635e290a-5b69-40fa-9ae3-b62d6686e0a8@h38g2000yqn.googlegroups.com>,
pozz <pozzugno@gmail.com> wrote:
> I don't know if Unix sockets (or named sockets) are C standard. I
> think so, so I post on this ng.
>
> I need to have a bidirectional communication between two different
> process on the same computer. I'm using named socket with success.
>
> The protocol is on a text basis and is based on messages with an
> ending newline character (\n).
>
> Is it possible to have a stream pointer (FILE *) from the socket file
> descriptor so I'll be able to use fprintf() and similar functions?
On Unix you can use fdopen to wrap an open file descriptor in a FILE*. You may
want to use setvbuf to control the bufferring.
--
Damn the living - It's a lovely life. I'm whoever you want me to be.
Silver silverware - Where is the love? At least I can stay in character.
Oval swimming pool - Where is the love? Annoying Usenet one post at a time.
Damn the living - It's a lovely life. Alameda County Sheriff.