U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ MT-multithreading and servers » Socket functions calling order
Re: Socket functions calling order [message #13692 is a reply to message #13620] Tue, 22 January 2008 18:20 Go to previous message
captainc is currently offline  captainc
Messages: 278
Registered: December 2006
Location: New Jersey, USA
Experienced Member
zaurus, thanks for that example. I was definitely confused as to the reading and writing on the same socket as listening. I am new to socket programming, so I made the assumption that the socket that sees the initial connection had to be used to transfer information.

I still wonder, how does Accept() work together with ServerSocket()?

On my initial analysis through the source code,
Calling ServerSocket() on a socket doesn't seem to implicitly call Accept() for that socket, although both ServerSocket() and Accept() call Attach(data) on the socket.
Further, ServerSocket() calls OpenServer(), which calls lower level calls bind() and listen() on the socket. Accept() calls lower level accept() on the socket.

Would you mind showing the full example of the main loop you provided?

 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: SocketEvent
Next Topic: MT Documentation
Goto Forum:
  


Current Time: Thu Sep 10 07:03:07 GMT+2 2026

Total time taken to generate the page: 0.02746 seconds