well im having some difficulties sending to the server i send but it never reaches the server?
anyways im including everything i think is relevant :P
Code:
case WM_WSAASYNC:
{
switch(WSAGETSELECTEVENT(lParam))
{
case FD_READ:
{
buffer=ReadData(hwndServerBox);
if(buffer.length()>0)
Analyze(hwndServerBox,buffer);
}break;
//-----------------------------------------------------------------------------------
bool WriteData(HWND hwndServerBox,string buffer)//the issue is in here as my data is never actually sent?
{
int nret;
int BytesToSend=sizeof(buffer);
if (BytesToSend<=0)
return false;
nret=send(sock,buffer.c_str(),BytesToSend,0);
if(nret==SOCKET_ERROR)
{
PostText(hwndServerBox,"Error: Send()");
return false;
}
else
PostText(hwndServerBox,buffer);
return true;
}
i was told to disregard WM_WRITE as it is only useful when sending large amounts of data because you have to fill up the network buffer...