Network Link Error 10049 Wsaeaddrnotavail
Contents |
360 games PC games windows socket error 10054 Windows games Windows phone games Entertainment All Entertainment
What Is A Socket Error
Movies & TV Music Business & Education Business Students & educators
Winsock Error 10053
Developers Sale Sale Find a store Gift cards Products Software & services Windows Office Free downloads & security Internet
Socket Error Codes Linux
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 Lumia All socket error 10054 connection reset by peer 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 socket error 11004 workings and policies of this site About Us Learn more about Stack socket error 10061 connection refused Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs socket error 11001 Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join https://support.microsoft.com/en-us/kb/819124 them; it only takes a minute: Sign up bind() fails with windows socket error 10049 up vote 1 down vote favorite I try to make a client/server program in C with IPv6 and UDP. When the program binds the socket it return the WSAError 10049. I know that this is a problem with the adress name but don't see http://stackoverflow.com/questions/14366048/bind-fails-with-windows-socket-error-10049 whats the problem. I hope someone can help. struct sockaddr_in6 server, client; SOCKET sock; char buffer[BUFFERSIZE]; LPTSTR recvBuff[1024]; DWORD recvBuffLen = 1024UL; int len = sizeof(client); WORD wVersionRequested; WSADATA wsaData; wVersionRequested = MAKEWORD(1,1); WSAStartup(wVersionRequested, &wsaData); sock = socket(AF_INET6, SOCK_DGRAM, 0); if (sock < 0) error("Fehler beim Anlegen des Sockets"); server.sin6_family = AF_INET6; server.sin6_port = htons(6000); server.sin6_addr = in6addr_any; if (bind(sock, (struct sockaddr *) &server, sizeof(server)) == -1) error("Fehler beim binden des Sockets"); c windows sockets bind share|improve this question asked Jan 16 '13 at 19:18 Markus Wilhelm 29224 What's PORT ? –Bart Friederichs Jan 16 '13 at 19:21 yeah it is defined, i changed the code to the real value –Markus Wilhelm Jan 16 '13 at 19:23 According to many Linux tutorials, you have to memset the sockaddr_in6 with zeroes. (I know it's Windows, but worth a shot) –Bart Friederichs Jan 16 '13 at 19:24 thanks now it works –Markus Wilhelm Jan 16 '13 at 19:43 add a comment| 3 Answers 3 active oldest votes up vote
This list is arranged numerically. See Microsoft's WinSock Error Codes for more extensive documentation. 10004 WSAEINTR http://frontier.userland.com/reference/windows/tcpErrorCodes -- Interrupted function call. 10013 WSAEACCES -- Permission denied. 10014 WSAEFAULT http://forums.codeguru.com/showthread.php?414359-RESOLVED-Sending-UDP-data-error-10049 -- Bad address. 10022 WSAEINVAL -- Invalid argument. 10024 WSAEMFILE -- Too many open files. Actually, it's too many open sockets. 10035 WSAEWOULDBLOCK -- Resource temporarily unavailable. 10036 WSAEINPROGRESS -- Operation now in progress. A blocking operation is in progress. 10037 WSAEALREADY -- Operation socket error already in progress. 10038 WSAENOTSOCK -- Socket operation on non-socket. 10039 WSAEDESTADDRREQ -- Destination address required. 10040 WSAEMSGSIZE -- Message too long. 10041 WSAEPROTOTYPE -- Protocol wrong type for socket. 10042 WSAENOPROTOOPT -- Bad protocol option. 10043 WSAEPROTONOSUPPORT -- Protocol not supported. 10044 WSAESOCKTNOSUPPORT -- Socket type not supported. 10045 WSAEOPNOTSUPP -- Operation not socket error 10054 supported. 10046 WSAEPFNOSUPPORT -- Protocol family not supported. 10047 WSAEAFNOSUPPORT -- Address family not supported by protocol family. 10048 WSAEADDRINUSE -- Address is already in use. If you attempt to set up a server on a port that is already is in use, you will get this error. 10049 WSAEADDRNOTAVAIL -- Cannot assign requested address. 10050 WSAENETDOWN -- Network is down. 10051 WSAENETUNREACH -- Network is unreachable. 10052 WSAENETRESET -- Network dropped connection on reset. 10053 WSAECONNABORTED -- Software caused the connection to abort. A connection that has been made was aborted, usually due to connection or protocol error. 10054 WSAECONNRESET -- Connection reset by peer. This occurs when an established connection is shut down for some reason by the remote computer. 10055 WSAENOBUFS -- No buffer space available. 10056 WSAEISCONN -- Socket is already connected. 10057 WSAENOTCONN -- Socket is not connected. 10058 WSAESHUTDOWN -- Cannot send after socket shutdown. 10060 WSAETIMEDOUT -- Connection timed out. 10061 WSAECONNREFUSED -- Connection refuse
Forum Visual C++ & C++ Programming Network Programming [RESOLVED] Sending UDP data error 10049 If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register or Login before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 2 of 2 Thread: [RESOLVED] Sending UDP data error 10049 Tweet Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode February 9th, 2007,12:29 PM #1 nice_guy_mel View Profile View Forum Posts Member Join Date Mar 2005 Posts 99 [RESOLVED] Sending UDP data error 10049 I don't have a lot of experience using SOCKET and sockaddr_in but I found some examples that are 'supposed' to work. I have a UDP server who is supposed to bind to a given port, then broadcast data through that port. Here is my code: Code: // In my header file SOCKET m_hSocket; sockaddr_in m_UDPInfo; unsigned short m_usPort; // In my bind method WSADATA wsaData; WSAStartup(MAKEWORD(2, 2), &wsaData); int nOpt = 1; m_hSocket = socket(AF_INET, SOCK_DGRAM, 0); setsockopt(m_hSocket, SOL_SOCKET, SO_BROADCAST, (char*)&nOpt, sizeof(int)); nOpt = 1000; setsockopt(m_hSocket, SOL_SOCKET, SO_RCVTIMEO, (char*)&nOpt, sizeof(int)); //At this point I've check each of the above lines for SOCKET_ERROR, but all //returned fine. memset(&m_UDPInfo, 0, sizeof(m_UDPInfo)); m_UDPInfo.sin_family = AF_INET; m_UDPInfo.sin_addr.s_addr = INADDR_ANY; m_UDPInfo.sin_port = htons(m_usPort); bind(m_hSocket, (sockaddr*)&m_UDPInfo, sizeof(m_UDPInfo)); //Still no SOCKET_ERROR so I think the actual binding part is ok. //Now when I need to send some data through I use void CTSocket::Write(const char* pData, int nLen) { send(m_hSocket, pData, nLen, 0); //also have tried sendto(m_hSocket, pData, nLen, 0, (sockaddr*)&m_UDPInfo, sizeof(m_UDPInfo)); } When I try using send I get error 10057 WSAENOTCONN meaning the socket was not connected, but I don't see why since none of the bind or setsockopt methods had any errors. When I try using sendto I get error 10049 WSAEADDRNOTAVAIL meaning the