If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Socket function "Select" crashes...????

Hi,

In one of my application the socket function call "Select" crashes. It doesn't happen everytime. If anyone knows the reason for the "Select" function to crash.
I checked for the proper values in the FD_Set structure for writefds and its proper i.e. {1, socket_handle}. I am not able to figure out the reason for the crash to happen with "Select" function.

Re: Socket function "Select" crashes...????

In one of my application the socket function call "Select" crashes. It doesn't happen everytime. If anyone knows the reason for the "Select" function to crash.

Faulty coding on your part.

I checked for the proper values in the FD_Set structure for writefds and its proper i.e. {1, socket_handle}. I am not able to figure out the reason for the crash to happen with "Select" function.

The first thing you should do is to get a sample application not written by you that uses the Socket() function, and see if it works with no errors. If it works, then again, it is faulty coding in your application that only you can solve since we don't have your program.

Re: Socket function "Select" crashes...????

Thanks Paul ! By faulty coding you mean to say that there may be the chances of invalid socket handle, invalid FD_Set struct right ??? I cannot share my code but thanks for your reply i'll check once more on the parameters being sent to the "Select" function.

Re: Socket function "Select" crashes...????

Originally Posted by LOOSER_007

Thanks Paul ! By faulty coding you mean to say that there may be the chances of invalid socket handle, invalid FD_Set struct right ???

Faulty coding could be anything. You're programming in C++, and any mistakes anywhere can cause problems at any place or time in the program. That's why no one can give you an answer as to what the problem is.

That's also why it is better you get a small working application not written by yourself, and see if it works with your parameters and data. Just grab something that is 10 or 20 lines long off the Internet, compile it, and run it with your parameters. Then you know if what you're doing really works correctly.

* The Perfect Platform for Game Developers: Android
Developing rich, high performance Android games from the ground up is a daunting task. Intel has provided Android developers with a number of tools that can be leveraged by Android game developers.

* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.