CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2008
    Location
    India
    Posts
    186

    Exclamation 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.

    Any help !

    Thanks!
    Last edited by LOOSER_007; November 30th, 2012 at 02:20 PM.

  2. #2
    Join Date
    Apr 1999
    Posts
    27,449

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

    Quote Originally Posted by LOOSER_007 View Post
    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.

    Regards,

    Paul McKenzie

  3. #3
    Join Date
    Aug 2008
    Location
    India
    Posts
    186

    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.

  4. #4
    Join Date
    Apr 1999
    Posts
    27,449

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

    Quote Originally Posted by LOOSER_007 View Post
    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.

    Regards,

    Paul McKenzie

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured