a Winsock Crash Course

Any other programming language that is not covered in the Web Scripting category.

a Winsock Crash Course

Postby Netmaster on Mon Feb 26, 2007 7:14 pm

Hello Folks!

To all who adopted C++ as their second language (lol) and are btw interested in Network Programming should risk a look @ this http://www.nullterminator.net/winsock.html
can be very useful in case ya don't wanna mess with MSDN or ya don't own it , despite that there also much more detailed guides and tut's but HEy:
This ain't nothing but a Crash Course! Very Happy

EnJoY

Netmaster
I've pinged god but didn't receive any Sign of Life.
God has been probably knocked out by SATAN!
Netmaster
Contributer
Contributer
 
Posts: 57
Joined: Thu Feb 22, 2007 9:11 pm

Re: a Winsock Crash Course

Postby crack0 on Mon Feb 26, 2007 11:20 pm

thanks for the link, very usefull Wink
Remember happiness can be found even in the darkest of times who only remembers to turn on the light
crack0
Regular
Regular
 
Posts: 111
Joined: Sun Dec 18, 2005 7:48 pm
Location: serbia

Re: a Winsock Crash Course

Postby Netmaster on Tue Feb 27, 2007 3:40 pm

^^that's good! Very Happy

btw here is a more detailed one (much more detailed Wink ) http://tangentsoft.net/wskfaq/
I've pinged god but didn't receive any Sign of Life.
God has been probably knocked out by SATAN!
Netmaster
Contributer
Contributer
 
Posts: 57
Joined: Thu Feb 22, 2007 9:11 pm

Re: a Winsock Crash Course

Postby alg8662 on Wed Feb 28, 2007 12:43 am

Winsock! Oh the horror! Why not learn Berkley Sockets?? Very Happy
alg8662
Contributer
Contributer
 
Posts: 56
Joined: Fri Aug 04, 2006 1:22 pm

Re: a Winsock Crash Course

Postby Netmaster on Wed Feb 28, 2007 2:11 pm

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

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=3
Our 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! Mad
anyways I hope that somebody can find this useful Smile
Cheers

Netmaster
I've pinged god but didn't receive any Sign of Life.
God has been probably knocked out by SATAN!
Netmaster
Contributer
Contributer
 
Posts: 57
Joined: Thu Feb 22, 2007 9:11 pm


Return to Programming

Who is online

Users browsing this forum: No registered users and 2 guests

cron