开发者

Winsock Select() function gives 0xC00000FD exception

I've a select based server. Sockets are in blocking mode,but for select() function I'm using 250 ms. timeout.

Basically my server accepts only one client and sending data to that client. I开发者_Go百科t is working for weeks without problem if I just send data from server to client.

But I realized that if client sends data to server after 3-4 hours at the select() line it gives stack overflow exception (0xC00000FD). I red dozens of times MSDN page of Select(), but nothing mentioned related to this. I'm really stuck. Any help will be appreciated.

By the way, I found on the net, example;

http://tangentsoft.net/wskfaq/examples/basics/select-server.cpp

here after accepting client connection, he is setting it to nonblocking mode. And it is commented that;

 // Mark the socket as non-blocking, for safety.

What does "safety" means above? So do you think is this my problem? Because in my implementation, connected ones are in blocking mode?

Thanks in advance


An exception means there is a bug in your code. Since you are getting a stack overflow, you likely have a recursive loop in your code that is running too long, eating up stack space on each call until there no more stack space left. Under normal conditions, select() returns an error code when it fails, so you have to be messing up your program's memory somewhere to be getting an exception.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜