Re: select(), sending and receiving data



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
.



Relevant Pages

  • Re: FTP Site wont work
    ... but no welcoming message or such ... it says it times out waiting for a server response ... > What do you actually see, when accessing the FTP server using a comand ... >> Dallas, Texas ...
    (microsoft.public.win2000.security)
  • Re: One of my servers is snooping another system...why?
    ... in your first sentence, that one of your ... First thing that sprang to mind was ROOTKIT ... You didn't say what the server is running so can't be anymore specific, could be a rootkit on a webserver with php bug, ftp server thats been compromised, could be a smb server with wrong permisions, nfs mount compromise or funny script written by silly user ...
    (comp.unix.solaris)
  • Re: ADO Data Control CacheSize causing Locks in SQL Server?
    ... advisable to fetch all the records from SQL Server that are generated by ... records on the Server as you seem to indicate. ... This first sentence says that CacheSize determines ... >trip to the server. ...
    (microsoft.public.sqlserver.programming)
  • Re: why were not going to see any new servers for a while.
    ... Re-read the first paragraph of my post and consider what I said in the context of the word "transfer" that was used in the first sentence. ... am waiting for a server _transfer_ and if a new _transfer_ server is offered for my old server then I am leaving my old server. ...
    (alt.games.warcraft)