I am making a simple chat program using winsock.

if I don't use WSAAsyncSelect(.....) and just use
d=connect(s,(struct sockaddr *)&a,sizeof(a));

d gives 0 "No error" but I can send to server only I can't get data from server.

but if I use

WSAAsyncSelect(.....)
d=connect(s,(struct sockaddr *)&a,sizeof(a));

d gives error but it works and I can send and receive.

So how to check wether connection has established or not?