What causes a WinSock error?
This error occurs when a program tries to bind a socket to an IP address/port that was already in use for an existing socket, or to a completely new socket that has not been properly closed, i.e., let’s say one that is still in a special closing process . .
you have a problem, it could be error 10014!!
I’m trying to check memory and thus socket values. What do you think about it?
What do I need to do? Please help my life….!
How do you fix a socket error?
A “socket error” indicates that the data offered on the network did not arrive in time. The easiest solution to this problem is to perform a factory reset and update the firmware. If the socket error prevails, try connecting to the lamp directly from the computer.
What I tried:
#include “cUDPReceiver.h”cUDPReceiver::cUDPReceiver (empty)cUDDPReceiver::~cUDPReceiver (empty)void cUDPReceiver::Initialize(SOCKET _socket)m_socket==_socket;ZeroMemory(&m_overlapped,sizeof(m_overlapped));m_nflags 0;m_wsaBuf.len = BUF_SIZE;m_wsaBuf.M_buf;On receiving();void buf = cUDDPReceiver::OnRecv()DWORD dwBytes is 0, dwFlags=0;integer return value is 0;ZeroMemory(&m_overlapped,sizeof(m_overlapped));ZeroMemory(&m_lastSenderAddr,sizeof(m_lastSenderAddrr));m_addrSize = sizeof(m_lastSenderAddr);m_wsaBuf.buf = m_queueBuffer.GetBufferPoint();m_wsaBuf.len = m_queueBuffer.GetRecvBytes();__LOCK;returnValue is WSARecvFrom(m_socket,&m_wsaBuf,one,&dw bytes,&dw Flags,(SOCKADDR *)&m_lastSenderAddr,&m_addrSize,&m_overlapped,ZERO);__OPEN;if ( == returnValue SOCKET_ERROR )if(WSAGetLastError()!= WSA_IO_PENDING)On receiving();void cUDPReceiver::OnSend(SOCKADDR_IN _addr, char* pData, const int _nSize)DWORDdwBytes=0;int returnValue means 0;__LOCK;m_wsaBuf.buf = pData;m_wsaBuf.len_nSize; equalsreturn value = WSASendTo(m_socket, &m_wsaBuf, 1,&dwbytes, 0, (SOCKADDR *) and _addr,sizeof(_addr), &m_overlapped, NULL);__OPEN;if (returnValue == SOCKET_ERROR)if(WSAGetLastError() != WSA_IO_PENDING)printf(“Error – wsasend failedn”);void cUDPReceiver::SetLength(DWORD _dwSize)m_wsaBuf.len = _dwSize;m_queueBuffer.PushData(_dwSize);char* cUDPReceiver::GetBuffer()Returns m_queueBuffer.PopData();SOCKADDR_IN cUDDPReceiver::GetLastAddr()Returns m_lastSenderAddr;void cUDPReceiver::Dispatch(char* pData)