10038 Socket Error Code
Contents |
Studio 2015 products Visual Studio Team Services Visual Studio Code Visual Studio Dev Essentials Office Office Word/Excel/PowerPoint Microsoft Graph Outlook OneDrive/Sharepoint Skype Services Store Cortana Bing Application Insights Languages & platforms Xamarin ASP.NET C++ TypeScript windows socket error 10038 .NET - VB, C#, F# Server Windows Server SQL Server BizTalk Server SharePoint socket error 10038 delphi Dynamics Programs & communities Students Startups Forums MSDN Subscriber downloads Sign in Search Microsoft Search Windows Dev Center Windows Dev Center 10038 socket operation on non-socket Explore What’s new for Windows 10 Intro to Universal Windows Platform Coding challenges Develop for accessibility Build for enterprise Windows Store opportunities Docs Windows apps Get started Design and UI Develop API reference socket error code 10061 Publish Monetize Promote Games Get started UI design Develop Publish Desktop Get started Design Develop API reference Test and deploy Compatibility Windows IoT Microsoft Edge Windows Holographic Downloads Samples Support Why Windows Dashboard Explore What’s new for Windows 10 Intro to Universal Windows Platform Coding challenges Develop for accessibility Build for enterprise Windows Store opportunities Docs Windows apps Get started Design and UI Develop API reference Publish Monetize
Socket Error Code 111
Promote Games Get started UI design Develop Publish Desktop Get started Design Develop API reference Test and deploy Compatibility Windows IoT Microsoft Edge Windows Holographic Downloads Samples Support Why Windows Dashboard Networking and Internet Windows Sockets 2 Winsock Reference Winsock Reference Windows Sockets Error Codes Windows Sockets Error Codes Windows Sockets Error Codes Socket Options Winsock IOCTLs Winsock Annexes Winsock Enumerations Winsock Functions Winsock Structures and Typedefs Winsock Tracing Events Winsock SPI Windows Sockets Error Codes TOC Collapse the table of content Expand the table of content This documentation is archived and is not being maintained. This documentation is archived and is not being maintained. Windows Sockets Error Codes Most Windows Sockets 2 functions do not return the specific cause of an error when the function returns. For information, see the Handling Winsock Errors topic. The WSAGetLastError function returns the last error that occurred for the calling thread. When a particular Windows Sockets function indicates an error has occurred, this function should be called immediately to retrieve the extended error code for the failing function call. These error codes and a short text description associated with an error code are defined in the Winerror.h header file. The FormatMessage function can be used
One games Xbox 360 games PC
Socket Error Code 10060
games Windows games Windows phone games Entertainment All socket error code 0 Entertainment Movies & TV Music Business & Education Business Students & socket error code 10053 educators Developers Sale Sale Find a store Gift cards Products Software & services Windows Office Free downloads & security https://msdn.microsoft.com/en-us/library/windows/desktop/ms740668(v=vs.85).aspx Internet Explorer Microsoft Edge Skype OneNote OneDrive Microsoft Health MSN Bing Microsoft Groove Microsoft Movies & TV Devices & Xbox All Microsoft devices Microsoft Surface All Windows PCs & tablets PC accessories Xbox & games Microsoft Band Microsoft https://support.microsoft.com/en-us/kb/155738 Lumia All Windows phones Microsoft HoloLens For business Cloud Platform Microsoft Azure Microsoft Dynamics Windows for business Office for business Skype for business Surface for business Enterprise solutions Small business solutions Find a solutions provider Volume Licensing For developers & IT pros Develop Windows apps Microsoft Azure MSDN TechNet Visual Studio For students & educators Office for students OneNote in classroom Shop PCs & tablets perfect for students Microsoft in Education Support Sign in Cart Cart Javascript is disabled Please enable javascript and refresh the page Cookies are disabled Please enable cookies and refresh the page CV: {{ getCv() }} English (United States) Terms of use Privacy & cookies Trademarks © 2016 Microsoft
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 about Stack Overflow http://stackoverflow.com/questions/15504016/c-winsock-socket-error-10038-wsaenotsock the company Business Learn more about hiring developers or posting ads with us Stack http://www.masmforum.com/board/index.php?PHPSESSID=786dd40408172108b65a5a36b09c88c0&topic=7243.0 Overflow Questions Jobs Documentation 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 only takes a minute: Sign up C++ Winsock Socket Error: 10038 (WSAENOTSOCK) up vote 4 down vote favorite 1 I have an master socket error slave application Master running on WinXp(i7, 2.1 Ghz) and slave being a controller board. The master sends request to the slave and the slave in response send to the master the data cyclically. This data send cyclically by the slave is 1000 bytes per 0.5 msec. When the masters makes the request to send the data, on the console an error is reported. " Select() function error code:: 10038 ". This is socket error code the code for WSAENOTSOCK. This application is a single threaded application receiving the data from the slave. As from the error it seems that the socket is closed before it is checked by the select function. Can any one please point me in the direction ? :::Source Code:::: int Receive() { int rc; socklen_t cli_alen; struct timeval to; fd_set read_fd, write_fd, excep_fd; FD_ZERO(&write_fd); FD_ZERO(&excep_fd); sock_again: if (!_isSocketOpen) { return 0; } FD_ZERO(&read_fd); FD_SET(_sock_fd, &read_fd); to.tv_sec = 0; to.tv_usec = 0; cli_alen = sizeof(SOCKADDR_IN); rc = select(_sock_fd+1, &read_fd, &write_fd, &excep_fd, &to); if (rc == 0 ) { // Timeout // printf("XCP Port %d : select() timded out \n", _port); acess = 1; goto sock_again; } else if (rc == SOCKET_ERROR) { // Error LogError("XCP: select() error %d", WSAGetLastError()); closesocket(_sock_fd); return -1; } else { // Data if (!FD_ISSET(_sock_fd, &read_fd)) { LogError("XCP: select() wrong socket descr"); return -1; } else { //read data rc = recvfrom(_sock_fd, (char *)_recvBuf, UDP_RECVBUFLEN, 0, (LPSOCKADDR)&_saddr, &cli_alen); } } } :::: Edited :::: int CloseUdpConnection() { if (closesocket(_sock_fd) == SOCKET_ERROR) { LogError("closesocket() error: %d", WSAGetLastError()); return -1; } _isSocketOpen = 0; LogError("successfully closed socket %s:%d", _address, _port); return 0; } ::::: Debug Trace ::::: xcpApplication.exe -i 192.168.1.100 -p 5555 c --> Connecting... <-- Connection established t --> Setting daq signal l
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 10665 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