Re: Client to connect to a chat server



Thank you very much Mihai!
I was thinking that the solution was somenthing like using select but
I wasn't certain.
If I have a program that read from a keyboard, it reads from a file
stdin, and when it reads from a server, it reads from a socket. Both of
them have a file descriptor.
So, I can use select to see in which file there are some activities,
I can control the file descriptor and I can read only from the file who
has some data.

Thank you again.

Nikolaj

.



Relevant Pages

  • Re: Help me code a small programming exercise? File descriptors...
    ... > I need to write a program that firstly, sleeps for 5 seconds, then reads ... > a line of input from file descriptor 0 and then writes the line back to ... > text on the keyboard, but I can't get a working program to try. ... Try the following buzzwords on google and also on google advanced groups: ...
    (comp.lang.c)
  • Help me code a small programming exercise? File descriptors...
    ... I need to do this exercise, ... I need to write a program that firstly, sleeps for 5 seconds, then reads ... a line of input from file descriptor 0 and then writes the line back to ... text on the keyboard, but I can't get a working program to try. ...
    (comp.lang.c)
  • Re: debian-user-digest Digest V2005 #865
    ... > that stdin is coming from some other filehandle than the keyboard, ... > a file descriptor, a pipe, a regular file, or a FIFO. ...
    (Debian-User)