I've got the connect to server working fine, but the issue is of receive, when I invoke receive the thread hangs!!!
Here's the extract of the code
while ( ii != 0)
ii = recv(sd,aa,1000,0);
Any Help would be Appreciated a lot!!!
Your code isn't C++, please post on an appropriate board in future.
Please read this thread regarding code tags.
In answer to your question, I'd guess its hanging because the socket is blocking (ie waiting for incoming data).
You can read about socket programming here.