Hi All,
I want to know the difference between Asynchronous and Synchronous Sockets.
where can i get them ?
Thanks
Printable View
Hi All,
I want to know the difference between Asynchronous and Synchronous Sockets.
where can i get them ?
Thanks
Try this for the differences. I dont understand what you mean by "where can i get them ?".
HTH,
Regards,
Usman.
you use winsock.. if you are using vc++, you should already "have them".
i have only worked with winsock 1.1.. so i can show you how to set up your project to use that.. but i don't know how to do it wiht winsock 2 (which you should use...)
for winsock 1.1, to to project->settings, link tab and add "wsock32.lib" at the end of the list (or it might be empty depending on your project) of object/library modules.
place this code before you do any socket operations (it starts up winsock)
once you've done that, you are good to use socket operations..Code:WORD wVersionRequested = MAKEWORD(1,1);
WSADATA wsaData;
int nRet;
nRet = WSAStartup(wVersionRequested, &wsaData);
if (wsaData.wVersion != wVersionRequested)
{
fprintf(stderr,"\n Wrong version\n");
return;
}
but since it seems you are just starting out with sockets programming, i would recommend you try and find out how to do the same process for winsock 2.. (it is different)..
the appropriate file to include is "winsock.h" for the old version.
oh.. synchronous and asynchronous are also called blocking and non-blocking.. i'm sure you will come across either pair of words when you do your research.. personally i prefer to call them blocking/nonblocking since it describes their behaviour.. i can never keep synhc, asynch straight..