I declared
static SOCKET socket;
static SOCKET client ;
in dialog.h

socket.create()
socket.listen()

OnAccept()
{
Accept(client,0,0);
client.Send(data,strlen(data));//it works fine here
}

BUT in dialog.cpp(main)
I start another thread for serial comms...
in that thread, I tried

client.Send(data,strlen(data));

IT doesnt work....
so I did a check b4 I send.....

Client.GetPeerName(ClientIP,portnumber);
// ClientIP=""
//portnumber=3435973836

above r the numbers I got
the obj is not the one that I have in OnAccept.....
any idea wat happened?