Error 10038 Wsagetlasterror
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you socket error 10038 might have Meta Discuss the workings and policies of this wsagetlasterror 0 site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers what is a socket error or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community socket error 10053 of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up connect() function fails wsagetlasterror() 10038 up vote 0 down vote favorite Hello i am a beginner socket/c programmer and from this tutorial i have the connect function returns 10038 error. please help. what am i
Socket Error 10049
doing wrong? also whats the difference between winsock and winsock2? also in connect() function definition there is int PASCAL what is pascal for? #include
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings
Socket Error 10054 Connection Reset By Peer
and policies of this site About Us Learn more about Stack Overflow socket error codes linux the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation wsagetlasterror 10038 Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it http://stackoverflow.com/questions/14289998/connect-function-fails-wsagetlasterror-10038 only takes a minute: Sign up bind() fails with windows socket error 10038 up vote -1 down vote favorite I'm trying to write a simple program that will receive a string of max 20 characters and print that string to the screen. The code compiles, but I get a bind() failed: 10038. After looking up the error number on msdn http://stackoverflow.com/questions/2891865/bind-fails-with-windows-socket-error-10038 (socket operation on nonsocket), I changed some code from int sock; to SOCKET sock which shouldn't make a difference, but one never knows. Here's the code: #include
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more http://stackoverflow.com/questions/4982132/wsaeventselect-error-10038 about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack http://www.masmforum.com/board/index.php?PHPSESSID=786dd40408172108b65a5a36b09c88c0&topic=7243.0 Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up WSAEventselect Error: 10038 up vote 0 down vote favorite I've been socket error trying to figure this out for a while now and I need help because I'm out of ideas. My WSAEventselect function returns error number 10038. Code: // Error checking.... if(netEvent.iErrorCode[FD_ACCEPT_BIT] != 0) { int temp1 = WSAGetLastError(); emit ClientErrorSignal(); return; } // Initializing socket if((newClient = accept(this->info->socket, NULL, NULL)) == INVALID_SOCKET) { int temp2 = WSAGetLastError(); emit ClientErrorSignal(); return; } // This is where the error occurs if(WSAEventSelect(newClient, &this->info->event, error 10038 wsagetlasterror FD_READ|FD_CLOSE) == SOCKET_ERROR) { int temp3 = WSAGetLastError(); emit ClientErrorSignal(); return; } this->info is a struct that is passed into the thread. typedef struct { SOCKET socket; int size; bool isTcp; WSAEVENT event; } SINFO, *PSINFO; c++ sockets winsock share|improve this question edited Feb 13 '11 at 2:52 Adam Rosenfield 242k66372493 asked Feb 13 '11 at 2:50 Koralarts 5201124 add a comment| 2 Answers 2 active oldest votes up vote 2 down vote accepted According to the Winsock error reference, this is a WSAENOTSOCK error, meaning you're trying to do something with an invalid socket handle. Without more information about where the error is occurring in your code I don't think I can offer much more advice than that, but I'd suggest checking to ensure that you're creating the socket correctly (perhaps the call to accept on an uninitialized socket is the culprit?) share|improve this answer answered Feb 13 '11 at 2:55 templatetypedef 199k44496753 The accept itself should initialize newClient socket. That's what I am confused about since accept is not throwing any errors. –Koralarts Feb 13 '11 at 2:59 add a comment| up vote 1 down vote This may or may not be related to your problem, but the second para
Links and Website Archived Old Forum Files Links for VC and MASM 128553 Posts in 15254 Topics by 684 Members Latest Member: mottt The MASM Forum Archive 2004 to 2012 General Forums The Workshop (RESOLVED thanks tedd)Winsock Error Code: 10038 « previous next » Pages: [1] 2 Author Topic: (RESOLVED thanks tedd)Winsock Error Code: 10038 (Read 10702 times) blackwc Guest (RESOLVED thanks tedd)Winsock Error Code: 10038 « on: May 06, 2007, 05:28:56 AM » Code:scan proc uses edi invoke socket,AF_INET,SOCK_STREAM,0 .if eax != INVALID_SOCKET mov sock,eax .else invoke MessageBox,hwnd,NULL,addr error,MB_ICONERROR .endif invoke WSAAsyncSelect,sock,hwnd,WM_SOCKET,FD_CONNECT .if eax==SOCKET_ERROR invoke MessageBox,hwnd,NULL,addr error,MB_ICONERROR .endif ;------------------------------------ invoke GetWindowTextLength,hbox1 inc eax invoke GetWindowText,hbox1,addr target,eax ;------------------------------------ assume edi:ptr sockaddr_in mov [edi].sin_family, AF_INET invoke inet_addr,addr target mov [edi].sin_addr, eax invoke htons,80 mov [edi].sin_port,ax invoke connect,sock,edi,sizeof sockaddr_in .if eax==SOCKET_ERROR invoke WSAGetLastError invoke dwtoa,eax,addr buffer .if eax != WSAEWOULDBLOCK invoke MessageBox,hwnd,addr buffer,addr error,MB_ICONERROR .endif .else invoke closesocket,sock .if eax==SOCKET_ERROR invoke WSAGetLastError invoke MessageBox,hwnd,addr target,addr error,MB_OK .endif .endif assume edi:nothing retscan endpRight around "connect()" it returns 10038.Which is invalid or corrupt handle, What's wrong with it? « Last Edit: May 10, 2007, 06:24:02 PM by blackwc » Logged blackwc Guest Re: Winsock Error Code: 10038 « Reply #1 on: May 07, 2007, 06:12:20 PM » Any help would be greatly appreciated... Logged Tedd Procrastinator Extraordinaire Member Posts: 2210 Reality Bytes Re: Winsock Error Code: 10038 « Reply #2 on: May 07, 2007, 07:14:15 PM » Well you're checking for errors (good!) and displaying error message boxes (good) and then carrying on anyway (not good!!)If there's an error, then it's not a good idea to continue - you'll only get more errors (such as 10038: WSAENOTSOCK - which means the socket handle you're giving isn't a valid socket handle.) Logged No snowflake in an avalanche feels responsible. blackwc Guest Re: Winsock Error Code: 10038 « Reply #3 on: May 07, 2007, 09:32:58 PM » Quote from: Tedd on May 07, 2007, 07:14:15 PMWell you'r