|
-
June 10th, 2010, 04:40 PM
#1
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.
-
June 10th, 2010, 05:55 PM
#2
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.
-
June 11th, 2010, 12:22 PM
#3
Re: select() fails with 10038 porting on 64 bit
-
June 11th, 2010, 12:32 PM
#4
Re: select() fails with 10038 porting on 64 bit
 Originally Posted by TdUser
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|