Re: TCP server stop receiving new connections

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



On Jul 13, 1:46 am, Julián Rodríguez Bajo
<julian.rodrig...@xxxxxxxxxx> wrote:
Alexander Nickolov escribió:

What do you do in your OnAccept handler? In particular,
do you try to accept multiple sockets? A test to try is to
reset the event mask of your listening socket each time you
exit its OnAccept handler.

Also, as a reality check - make sure your message loop
never gets stuck... E.g. when you break into the debugger,
almost always you should end up in the message loop.

Hi Alexander.

In OnAccept I just accept one incomming connection, since as
documentation of WSAAsyncSelect says, FD_ACCEPT is posted after an
accept call if there is another connection request available to accept.
BTW, I have tested with a loop in OnAccept handler to accept all pending
connection requests and behaviour did not change.

The problem is that OnAccept handler is not called for a long time
(maybe 1, 2 or even 5 minutes).

OTOH, the first time I open the server socket, everything works fine,
even if there are 50 clients running trying to connect to the server
before I start the server. But after a shutdown/close/create/listen
sequence the problem appears. Maybe has something to do with the Socket
Notification Window creation/destruction by MFC framework?

Regards.

--snip--
Maybe has something to do with the Socket Notification
Window creation/destruction by MFC framework?

But ofcourse it seems problem with MFC. No offence, but thats the
reason i hate extra libraries, certainly ATL/STL/MFC etc. are meant
for quick development and prototypes rather for every single
solution.

Julián, how about writing a dll that will implement the server using
standard socket interfaces? And from the code portability prospective
you will be free to write number of interface on top of that
_dll_server_. A simple multi thread server would be doing that all and
use windows messaging for moving data back and forth.

Sure, debugging would be far more easy in this layered approach .


ali


.



Relevant Pages

  • Re: How to terminate a socket in CLOSE_WAIT state
    ... FTP Server fixed for certain FTP clients who use both passive ... This was causing a PASSIVE opened socket to be left ... but instead expect the "half close" from the receiver. ... this sends a TCP/IP FIN packet to the ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Socket switch delay
    ... both at the client and at the server (and why ... would you set the send buffer size to zero on a non-overlapped ... One glaring error is your client does ... So when you use a single socket, ...
    (microsoft.public.win32.programmer.networks)
  • Re: Applet Hangs when submitting data to servlet
    ... to put a time limit on my socket connections and socket reads. ... public void setTimeoutthrows UnknownHostException, ... on our web server. ... private JButton theSubmitButton_, theClearButton_; ...
    (comp.lang.java.programmer)
  • Re: Problem with writing fast UDP server
    ... UDP packets per second. ... socket and threads. ... I wrote a simple case test: client and server. ... The maximum theoretical limit is 14,880 frames per ...
    (comp.lang.python)
  • Re: Socket Exception
    ... In this case the server most likely rejected your ... connection. ... Each command is a new socket connection that is opened and closed ... /// Required designer variable. ...
    (microsoft.public.win32.programmer.networks)