Re: select(), sending and receiving data
- From: Markus Pitha <markus@xxxxxxxxxx>
- Date: Mon, 26 Dec 2005 12:03:48 +0000
Hello,
Pascal Bourguignon wrote:
> You need to let your editor indent correctly your code.
Sorry, but when I copy and paste it from the editor in here, it's
probably much more messy as when I align it on the left side.
> You need to reset the fd sets everytime.
Ok
> You need to flush the output.
Ok, I'll keep it in my mind.
> You need to avoid waiting for received packets (unless you mean it, it
> depends on your protocol).
Actually that's what I want to do. It should be more a Chat server
instead of a http server.
> Instead of block reading stdin, you could use select on it too, which
> would allow you to display incoming packets while the user types in
> his new message. (Some management of the screen would be needed,
> ncurses or at least manage raw input to be able to print back the
> current user input).
That's what I want to try next, but I want to make it step by step.
By the way. Your code seems to work, thanks for it. But there is
something I don't understand:
When I connect to the server, I don't get the Welcoming Message, but the
">"-sign of the code appears, which means that I'm able to type and send.
When I write the first sentence and send it, I finally get the welcoming
message after this first sentence, but moreover, the errormessage
"recv() in FD_ISSET: Resource temporarily unavailable" appears.
Probably there is still something wrong in my code, but I think I can
find the mistake by myself.
Best Regards,
Markus
.
- Follow-Ups:
- Re: select(), sending and receiving data
- From: Pascal Bourguignon
- Re: select(), sending and receiving data
- References:
- select(), sending and receiving data
- From: Markus Pitha
- Re: select(), sending and receiving data
- From: Pascal Bourguignon
- select(), sending and receiving data
- Prev by Date: Re: Waiting for a child to die
- Next by Date: Re: Filesystem MTA queue
- Previous by thread: Re: select(), sending and receiving data
- Next by thread: Re: select(), sending and receiving data
- Index(es):
Relevant Pages
|