CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2010
    Posts
    2

    select() fails with 10038 porting on 64 bit

    Hi

    I'm currently trying to port my working application from 32 bit to 64 bit.
    I see that the select() fails with error 10038. I did some research to find out the cause but
    unable to drill it to the root cause. Im doubting it's to do with 32 and 64 bit models.
    I tried to type cast based on some articles "converting from 32 bit to 64 bit " but no luck.
    Any help is highly appreciated..... Thanks in advance

    typedef struct {
    SOCKET s;
    Boolean Valid;
    }Sock_Type, *Sock_Ptr_Type;

    ****************
    Sock_Ptr_Type sockp;
    fd_set rfds, wfds, efds;
    struct timeval tv;
    int n;
    tv.tv_sec = 5;
    tv.tv_usec = 0;
    FD_ZERO(&rfds);
    FD_ZERO(&wfds);
    FD_ZERO(&efds);

    for(int sockcnt=0;sockcnt<2;sockcnt++)
    {
    if(sockp[sockcnt].Valid)
    {
    FD_SET(sockp[sockcnt].s,&rfds);
    FD_SET(sockp[sockcnt].s,&wfds);
    FD_SET(sockp[sockcnt].s,&efds);
    }
    }

    SOCKET temp = sockp[0].s;
    n = select(temp+1,&rfds,&wfds,&efds,&tv);

    ***********

    Error from select(): 10038
    An operation was attempted on something that is not a socket. The specified socket parameter refers to a file, not a socket.

  2. #2
    Join Date
    Feb 2005
    Posts
    2,160

    Re: select() fails with 10038 porting on 64 bit

    Please use [code][/code] tags around your code to make it easier to read.

    What type is "Boolean" in your Sock_Ptr_Type? It's not a standard type. It may be the problem if it is different widths in 64 v. 32bit environments.

  3. #3
    Join Date
    Jun 2010
    Posts
    2

    Re: select() fails with 10038 porting on 64 bit

    Boolean is unsigned char

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: select() fails with 10038 porting on 64 bit

    Quote Originally Posted by TdUser View Post
    Boolean is unsigned char
    Well, why is it not declared according to C++ standard as bool?
    Victor Nijegorodov

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