alg8662 wrote:Winsock! Oh the horror! Why not learn Berkley Sockets??

Well a good point indeed!
But since I'm
currently on windows and have no other option than using winsock , I've started this thread so that fellow programmers can benefit from my encounters with winsock incase they got into the same situation , you know..
Important Note to winsock coders:I've found that the tutorial provided in the first post , can be only useful in case you've installed what is known as "the platform sdk edition 2003" or later!
unfortunately , VC6 doesn't include it , Hey even VC.net 2003 architect edition doesn't supply the proper headers and libs in order to make use of that tutorial (unless you download an appro. 1gb sdk *sigh* or ya order a cd from JunkSoft)
SO after some tiresome look ups I've found that the winsock api that comes with VC7 and VC6 is still the old winsock2 win98 edtion , and ya need this toturial to get going with it:
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=2241&lngWId=3Our point of Interest is this example:
- Code: Select all
if (bind(Socket, (SOCKADDR *)(&SockAddr), sizeof(SockAddr)) == SOCKET_ERROR)
{
printf("Attempt to bind failed.");
}
you need to typecast the pointer to struct "sockaddr_in" into a pointer to "sockaddr" but what literally frustrated the hell out of me , was that both winsock api's have the same version number (2) , you could only guess how much confusion and chaos that has caused me ,
I guess that's another reason to loath Bill hates!

anyways I hope that somebody can find this useful
Cheers
Netmaster
I've pinged god but didn't receive any Sign of Life.
God has been probably knocked out by SATAN!