Sunteți pe pagina 1din 13

4/4/13

__Simple Winsock Tutorial__ by Matt Carpenter


(http://domain.com/PlanetSourceCode/default.asp)

Dream it. Code it. Login (http://domain.com/vb/authentication/Login.asp?lngWId=1&txtReturnURL=%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1) .Net (VB and C#) (http://domain.com/vb/default.asp?lngWId=10) PHP (http://domain.com/vb/default.asp?lngWId=8) Javascript (http://domain.com/vb/default.asp?lngWId=14) Java (http://domain.com/vb/default.asp?lngWId=2) C/C++ (http://domain.com/vb/default.asp?lngWId=3) SQL (http://domain.com/vb/default.asp?lngWId=5) Perl (http://domain.com/vb/default.asp?lngWId=6) ASP classic (http://domain.com/vb/default.asp?lngWId=4) VB classic (http://domain.com/vb/default.asp?lngWId=1) Delphi (http://domain.com/vb/default.asp?lngWId=7) Cold Fusion (http://domain.com/vb/default.asp?lngWId=9) Code/Articles (#) Newest (http://domain.com/vb/scripts/BrowseCategoryOrSearchResults.asp?
grpCategories=-1&optSort=DateDescending&txtMaxNumberOfEntriesPerPage=10&blnNewestCode=TRUE&blnResetAllVariables=TRUE&lngWId=1) Browse categories (http://domain.com/vb/scripts/BrowseAllCategories.asp?lngWId=1) Search (http://domain.com/vb/scripts/search.asp?lngWId=1) ----------------------- (#) Upload code / articles (http://domain.com/vb/authors/determine_author_type.asp?lngWId=1) Open letter from moderators (http://domain.com/vb/misc/OpenLetterFromPSCModerators.asp?lngWId=1) ----------------------- (#) Articles & tutorials (http://domain.com/vb/Tutorial/default.asp?lngWId=1) Recommended reading (http://domain.com/vb/Bookstore/default.asp?lngWId=1) Top Code (#) Coding contest (http://domain.com/vb/contest/ContestInfo.asp?lngWId=1) Coding contest leader board (http://domain.com/vb/contest/ContestAndLeaderBoard.asp?lngWId=1) Coding contest 'All-Time Hall of Fame' (http://domain.com/vb/scripts/BrowseCategoryOrSearchResults.asp? grpCategories=-1&txtMaxNumberOfEntriesPerPage=10&blnTopCode=True&blnResetAllVariables=TRUE&lngWId=1) ----------------------- (#) Code of the day newsletter (http://domain.com/vb/CodeOfTheDay/signup.asp?lngWId=1) Community (#) Ask a pro discussion forum (http://domain.com/vb/discussion/default.asp?lngWId=1) Code of the day newsletter (http://domain.com/vb/CodeOfTheDay/signup.asp?lngWId=1) Open letter from moderators (http://domain.com/vb/misc/OpenLetterFromPSCModerators.asp?lngWId=1) Jobs (#) Search for a job (http://domain.com/vb/jobs/SearchJobs.asp?lngWId=1) Post a job (http://domain.com/vb/jobs/PostJob.asp?lngWId=1) Other (#) My profile (http://domain.com/vb/authentication/MyPlanetSourceCode/CustomizeInfo.asp?lngWId=1) How to link to us (http://domain.com/vb/LinkToUs/default.asp?lngWId=1) Awards/Reviews/Raves! (http://domain.com/vb/about/Awards.asp?lngWId=1) Advertising/Media kit (http://domain.com/vb/advertisement/scripts/rates.asp?lngWId=1) Feedback (http://domain.com/vb/feedback/feedback.asp?lngWId=1) About the site (http://domain.com/vb/about/AboutTheSiteAndAuthor.asp?lngWId=1) Goto (#) Visual Basic home (http://domain.com/vb/default.asp?lngWId=1) Site home (http://domain.com/PlanetSourceCode/default.asp?lngWId=-1) Other sites (http://domain.com/vb/scripts/OtherLinks.asp?lngWId=1)
Important alert: (current site time 4/3/2013 9:39:02 PM EDT) Brand ne w: re com m e nde d re ading (http://www.planet- s ourc e- c ode.c om/vb/Books tore/default.as p? lngWI d=1 0 ) for e ve ry program m ing language on the site | re vam pe d discussion board (http://ques tions .planet- s ourc e- c ode.c om/os qa) | 7 Source C ode C Ds (http://www.exhedra.c om/exhedra/P lanetSourc eC ode/C D .as px)

(About the author)

__Simple Winsock Tutorial__

(http://domain.com/vb/authors/ShowBio.asp? lngAuthorId=3315126102&lngWId=1)

Like 0 Send (http://domain.com/vb/scripts/EmailToFriend.asp? lngWId=1&txtCodeId=30413&txtCodeName=%5F%5FSimple%2520Winsock%2520Tutorial%5F%5F&txtCodeDescription=This%2520tutorial%252 Email (http://domain.com/vb/scripts/EmailToFriend.asp? lngWId=1&txtCodeId=30413&txtCodeName=%5F%5FSimple%2520Winsock%2520Tutorial%5F%5F&txtCodeDescription=This%2520tutorial%252

Submitted on: 1/5/2002 12:42:24 AM By: Matt Carpenter Level: Intermediate User Rating: By 115 Users Compatibility: VB 6.0 Views: 160441

www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=30413&lngWId=1

1/13

4/4/13

__Simple Winsock Tutorial__ by Matt Carpenter

This tutorial will teach you the basics of winsock (the winsock OCX control). How to connect to computers, how to be a server, sending and getting data. If you like this, Please vote for me ;)

Terms of Agreement: By using this article, you agree to the following terms... 1. 2. 3. 4. You You You You may use this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge. MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws. may link to this article from another website, but ONLY if it is not wrapped in a frame. will abide by any additional copyright restrictions which the author may have placed in the article or article's description.

.::Simple Winsock Tutorial ::.


-From the author of 'Simple Direct3d Tutorial w/ source' on PSC!

This tutorial will teach you how to use the Winsock control to make chat programs, multiplayer games, email checkers, and anything else that uses Winsock!

Winsock is a communications 'thingy' that lets you communicate with other computers via network/internet. Using TCP/IP or UDP protocols, you can send data from one computer to another. We will be using the Winsock control with visual basic. First, open up visual basic, then add the Winsock Control. I also assume that you know what a port is...

Add one to your form. Now, make 2 command buttons. Label one 'Connect' and the other 'Host'. Under the 'connect' button, add the following code:

Host = inputbox("Enter the host's computer name or ip address:") Port = inputbox("Enter the host's port to connect to:") Winsock1.connect host, port

That code let you specify the host computers name/ip address, and the port to connect to on it. Now, add the following code to the 'Host' button.

Port = inputbox("What port do you want to host on?") Winsock1.localport = Port Winsock1.Listen

If you were to click the 'host' button, it would activate the server and wait for somebody to try to connect.

Now, double click the Winsock control and go to the sub 'winsock1_ConnectionRequest'. Under that, put this code.

if winsock1.state <> sckclosed then winsock1.close 'Got to do this to make sure the Winsock control isn't already being used. winsock1.accept RequestID

That code simply let the client connect. Now, add a 3rd button to the form and call it 'Send'. Under it, add this code.

Text = inputbox("Send what text?") winsock1.senddata text

www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=30413&lngWId=1

2/13

4/4/13

__Simple Winsock Tutorial__ by Matt Carpenter

When you click that, it sends data to the other computer, no matter if you are the host or the client. You need a way to receive this data on both, so double click the Winsock control, then go to the 'winsock1_RecieveData' sub (or something like that). Put in this code.

winsock1.getdata(data,vbstring,bytestotal) or is it winsock1.getdata data,vbstring,bytestotal? I think I might be mixing c++ syntax w/ visual basic :-/ msgbox Data

This displays the data that the other user sent you.

I guess I really didn't go in depth with this article, but it is all REALLY simple. Maybe you want to send player coordinates if you are making a multiplayer game, or send messages if it's a chat program that you want to make. Doesn't really matter.

To test this program, compile it, then open 2 instances of it. in one, click the 'host' button and enter the port 100 (Just because. You could do any port you want (1 to 1000 or higher!)) In the other one, click 'Connect' Then type in 'Localhost' for the server, and the port should be, guess what, 100! This will create a loop, and you will connect to your self. On one of the instances, click send, then type in a message. No, don't just type in any message, type 'Hello World!'. How original is that? Click OK, then a message box from the other instance should pop up with the same message. You could also use 127.0.0.1 for the host instead of Localhost, because that is the same thing as Localhost, only in an IP address. I guess this doesn't TEACH you how to make multiplayer games, but at least you know how to now...

That was a real simple tutorial. Not much else to say, except, Please vote for me if you liked this!

document.write("

Other 19 submission(s) by this author (http://domain.com/vb/scripts/BrowseCategoryOrSearchResults.asp?

lngWId=1&blnAuthorSearch=TRUE&lngAuthorId=3315126102&strAuthorName=Matt%20Carpenter&txtMaxNumberOfEntriesPerPage=25)

Report Bad Submission


Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.). This submission should be removed because: Report it!

Your Vote What do you think of this article (in the Intermediate category)?
(The article with your highest vote will win this month's coding contest!) (http://domain.com/vb/contest/contest.asp? lngWId=1)

Excellent

Good

Average

Below Average

Poor Rate It! (See voting log ... (http://domain.com/vb/scripts/voting/VoteLog.asp?

txtCodeId=30413&txtCodeName=__Simple%20Winsock%20Tutorial__&intUserRatingTotal=509&intNumOfUserRatings=115&lngWid=1) )

www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=30413&lngWId=1

3/13

4/4/13

__Simple Winsock Tutorial__ by Matt Carpenter

Other User Comments

1/6/2002 3:59:18 PM: Peter Schmitz (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=227790901&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Actually, I'd recommend against using any port under 2000 or so, because of other services commonly running on those ports... If you want to be safe, and make sure that the most default portscans won't pick up your open port, chose a port over 5000. (If this comment was disrespectful, please report it (#) .)

1/7/2002 3:43:37 AM: J Pack (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=2212131391&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Thanks for your short but to the point Tutorial. I gave you a 5 rating but I did have to make a small change to get it to work properly. I changed your line of code "Data = winsock1.getdata" to "Winsock1.GetData Data". It works fine now. (If this comment was disrespectful, please report it (#) .)

1/7/2002 7:10:20 PM: dumbass (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=2211725811&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

I had to do the same as the person above. To compile: change "Data = winsock1.getdata" to "Winsock1.GetData Data". (If this comment was disrespectful, please report it (#) .)

1/16/2002 10:05:52 AM: d3 (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=3315805592&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

I thought this tutorial is short but sweet, it told me everything I needed to know :) (If this comment was disrespectful, please report it (#) .)

1/16/2002 12:04:34 PM: d3 (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=3315805592&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

ok I thought this worked... I don`t know what it is but winsock wont work for me.... here is my code please can someone help!! Private Sub Form_Click() Port = InputBox( (If this comment was disrespectful, please report it (#) .)

1/22/2002 1:12:07 PM: Cessna 182 (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=3314512972&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Well this works fine other than that you must use: winsock1.GetData Data, vbString, bytesTotal because it will just give you a message box saying "???" if you dont (If this comment was disrespectful, please report it (#) .)

1/22/2002 1:17:31 PM: Guato (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=3317078192&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

I got everything to work, but all I get in the msgbox is a question mark for every two characters sent. Anyone know why? (If this comment was disrespectful, please report it (#) .)

1/22/2002 1:19:03 PM: guato (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=3317078192&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

haha, whoops, during my registration you answered my question before I posted it... erie... (If this comment was disrespectful, please report it (#) .)

1/25/2002 1:23:34 AM: Dan Wold (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=195759158&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

To: d3 "ok I thought this worked... I don`t know what it is but winsock wont work for me.... here is my code please can someone help!! Private Sub Form_Click() Port = InputBox( " from what i Pieced together from your message, I beleive this is what you needed... PortBox = InputBox("Please enter the port.","Port Number") Winsock.RemotePort = PortBox If not feel free To email me! (If this comment was disrespectful, please report it (#) .)

1/29/2002 12:05:45 PM: Maniac (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=2210681971&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Interesting tutorial. It all seems so easy now (If this comment was disrespectful, please report it (#) .)

2/2/2002 10:07:27 PM: angelo (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=2213010661&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

i've been at this winsock nonsense on and off for what seams like years now and i STILL haven't gotten the basics...so here's my latest problem...i have my program set up to simply MSGBOX me when i connect to it through IE on the designated port...i used Matt's code in listening, accepting RequestID, and DataArrival...however, i noticed in the accepting the RequestID it tells the winsock to close the connection: If wskMain.State <> sckClosed Then wskMain.Close wskMain.Accept requestID basically the program works the first time around and a messagebox pops up showing me the IE http header info...but then it won't work again...i'm thinking it's due to the fact i'm closing the connection w/ winsock, however the program won't work without closing the connection!?!?!? i'm stuck...should i relisten somewhere? if so i sure can't find the right spot to start relistening...PLEASE HELP!!! :) (If this comment was disrespectful, please report it (#) .)

2/6/2002 6:43:39 PM: Bob (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=3318736702&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=30413&lngWId=1

4/13

4/4/13

__Simple Winsock Tutorial__ by Matt Carpenter

Hey, I'm trying to make a server that can have 2 clients connected at a time. What do I need to do it? (If this comment was disrespectful, please report it (#) .)

2/23/2002 5:10:01 PM: Danny Weyand (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=3318183212&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

I don't have an ocx of winsock and have been trying to use the api calls does anyone know how to determine the data that you received? (If this comment was disrespectful, please report it (#) .)

3/6/2002 4:20:07 AM: Andrei Lisovoi (ALSI) (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=3316942182&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Nice tutorial! Very Basic though... Doesn't show how you could transfer files over the network, how to maintain more than 1 user... Lot's to do. 4 For effort though! (If this comment was disrespectful, please report it (#) .)

3/6/2002 9:38:37 AM: Terry (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=3315464062&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Could not get the code to work (VB6, W2K sp2) What am I doing wrong? (If this comment was disrespectful, please report it (#) .)

3/6/2002 1:38:06 PM: jb (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=2212787431&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Nice Simple & to the point. Dont forget to define the 'data' received as a string such as: Dim data as string. If you dont, you'll get the '??' question marks. (If this comment was disrespectful, please report it (#) .)

3/13/2002 4:58:00 AM: Shadowhunter (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=4422585413&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

I get a compile error: Syntax Error on the line "Data = Winsock1.GetData Data" anyone know how I can solve this? (If this comment was disrespectful, please report it (#) .)

3/17/2002 6:42:58 PM: Billy (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=3318321042&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Great job now i have mastered the basics of Winsock (If this comment was disrespectful, please report it (#) .)

3/29/2002 4:40:36 AM: Julio Montufar (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=774679886&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Excellent, give him the highest rate 6 (If this comment was disrespectful, please report it (#) .)

3/29/2002 7:31:38 PM: bulut (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=4421387503&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

hello and thank you for sharing i can get everything to work but one thing the ?'s marks show up. I tried what the other people said but MsgBox Data, vbString, bytesTotal does not work any suggestions (If this comment was disrespectful, please report it (#) .)

3/29/2002 7:38:04 PM: bulut (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=4421387503&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

oops i put it on the wrong line i got it now sorry (If this comment was disrespectful, please report it (#) .)

3/31/2002 1:57:38 PM: Gaurav (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=4424548213&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Accurate and to the point....great work (If this comment was disrespectful, please report it (#) .)

4/13/2002 11:08:59 AM: wah_tak (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=4425710843&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Cool tutorial! now i'm off to my first net-game!!! (If this comment was disrespectful, please report it (#) .)

4/15/2002 8:19:55 PM: Mystins (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=2211173651&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Nice tutorial. angelo, you have to use 2 winsock controls (you could use one, but I prefer order) 1 to always listen, never close it. The 2nd one needs to be an array. Do something like this Public Variables.. Dim Total as long if total = 0 then if arrayedwinsock(0).state = sckclosed then arrayedwinsock(0).close else arrayedwinsock(0).accept total = total + 1 load arrayedwinsock(total) arrayedwinsock(total).accept Requestid end if arrayedwinsock is the winsock with the array. The winsock controlling all of this is the normal, no array, winsock control. .......*looks at his text* ............. ok you can just email me at Mystinsuo@yahoo.com or icq 32363881 and I can help you. There's not enough room here to explain everything I need to explain. Now if I could only get my chatroom to work using microsofts extremely-slow-data-processing ocx... (If this comment was disrespectful, please report it (#) .)

4/15/2002 8:22:34 PM: Mystins (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=2211173651&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Nice example above on winsock, I remember using it a while back. erm.. Darn. I didn't remember that this thing reads coding ;) Just email me at Mystinsuo@yahoo.com (BIG SUBJECT) and I'll give you some help. But remember, if your going to email, make sure you remember you can't walk before you crawl. (If this comment was disrespectful, please report it (#) .)

4/17/2002 2:37:40 PM: Tatiane Ferrari (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=4426197623&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

How we could send the .XML file using Winsock ?? Someone may answer me ? Winsock.senddata (If this comment was disrespectful, please report it (#) .)

4/17/2002 2:39:44 PM: Tati Ferrari (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=4426197623&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Someone could help me?? How we may send an XML file using winsock ? winsock.senddata

www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=30413&lngWId=1

5/13

4/4/13
(If this comment was disrespectful, please report it (#) .)

__Simple Winsock Tutorial__ by Matt Carpenter

5/2/2002 4:35:10 PM: FosSiL (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=4427573753&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

yo great tutorial. I need something that will connect to a server and send it data from a game like the playername they are using. (If this comment was disrespectful, please report it (#) .)

5/6/2002 5:05:36 PM: Nick Fantis (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=4422401033&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Hey, can you guys tell me if there is any way to keep my IP from changing every time I log onto the internet? Thanks. (If this comment was disrespectful, please report it (#) .)

5/10/2002 1:00:56 PM: Alex (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=4426008483&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

I cant seem to make it work. 1)The host n port variable are not declare.So i declare it as string. 2)And i also cant find Private Sub Winsock1_RecieveData(ByVal data As Long) Can anyone help me by senting me a copy of this tutorial. Thanks. wodeming@hotmail.com (If this comment was disrespectful, please report it (#) .)

5/14/2002 10:54:27 AM: jore (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=4427231733&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

puyeng man (If this comment was disrespectful, please report it (#) .)

5/30/2002 2:07:51 PM: 10x man (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=5528273374&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

u really halped me but i had to read the commants for understading and for geting it work (If this comment was disrespectful, please report it (#) .)

6/17/2002 2:32:49 PM: underlaget (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=5528153324&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

A question :: Is there a code for Something like this: --------------------------------------If "User" Connected Then label1.caption = "User Is Connected" --------------------------------------This is like a beginning for my multiplayer game im developing ... i also have another question ... Here's what im planning to do : ---------------------------------------Lets say the game is an easy RPG kind and you get to choose between 4 different characters .... im gonna use something like this :: --------------------------------------Every "player" gets too choose 1 option between the 4 chars .. but how do i tell the others that that option (character) is taken .. like .. option1.enabled = False ... but how i tell the other guys program's aswell ?? Understand what i mean ?? If you only use option1.enabled = false then only that guy's program will change .. and not the others ... Im thankful for any answer i will get to theese 2 questiongs !! // Thnx (If this comment was disrespectful, please report it (#) .)

6/18/2002 11:52:40 AM: Dezzy (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=5532217454&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Short and sweet tutorial. How can I send a file to a remote computer and get the remote computer to start a batch file. (If this comment was disrespectful, please report it (#) .)

6/19/2002 5:05:14 AM: Nagesh (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=5532278774&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

hi, i tried the code after placing winsock control on my form1 with lil changes, Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long) Winsock1.GetData Data, vbString, bytesTotal MsgBox Data End Sub ---As u can see i tried the supported event winsock1_dataarrival instead of the suggested unsupported event recievedata... ---when i run the above code and click on connect and feed my local ip 192.168.1.216 and port as 5010 and click on send and feed the text as "hi" I GET THE RUNTIME ERROR 40006 "Wrong Protocol or connection state for the requested transaction or request" and i click on debug to find the debugger point the code line "Winsock1.SendData Text" help me plz. regards, nags (If this comment was disrespectful, please report it (#) .)

6/20/2002 3:52:56 PM: gavros tou kerata (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=4423895183&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

I dont know nothing about winsock. If you can give me some basic information.How to write ip adress(i know mine)but i dont know about ports etc. iwant to send a message to my self with winsock.please help (If this comment was disrespectful, please report it (#) .)

6/21/2002 1:25:52 AM: greg (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=5532066394&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

nice tutorial, basic as said.. but nice. (If this comment was disrespectful, please report it (#) .)

6/28/2002 1:27:41 AM: Matt (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=5533051574&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

For me, I had trouble with my client application because my server was always on a different IP address each time I logged onto the internet. So I wrote code on the server app to write to a CGI script on my webpage. This CGI script stores the IP my server uses each time I load it up. Then the client uses an HTTP protocol to retrieve this IP address stores on the web. It works great. Now I only have to work on having more than one client connected at once. :-) (If this comment was disrespectful, please report it (#) .)

6/30/2002 1:41:42 AM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=5532697094&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

This is my code Private Sub Command1_Click() Winsock1.Connect Text1.Text, 2002 End Sub Private Sub Command2_Click() Winsock1.LocalPort = 2002 Winsock1.Listen End Sub Private Sub Command3_Click() Winsock1.SendData Text2.Text

www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=30413&lngWId=1

6/13

4/4/13
End Sub Private Sub Command4_Click() Winsock1.Close End Sub Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long) If Winsock1.State <> sckclose Then Winsock1.Close Winsock1.Accept requestID End Sub Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long) Winsock1.GetData adata MsgBox adata End Sub

__Simple Winsock Tutorial__ by Matt Carpenter

Private Sub Winsock1_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean) MsgBox "Error" End Sub (If this comment was disrespectful, please report it (#) .)

7/3/2002 12:50:53 AM: raghuraja (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=5533254224&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

good (If this comment was disrespectful, please report it (#) .)

7/16/2002 12:43:44 PM: JOSHUA STEWARD (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=5532583274&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

THIS WAS JUST WHAT I NEEDED. THAT WINSOCK IS CONFUSING IF YOU DON'T UNDERSTAND IT. (If this comment was disrespectful, please report it (#) .)

7/31/2002 1:15:14 PM: DrDre (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=3318194692&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

uhh i read everyone and cant find my problem, when it tries to listen to the port i get runtime error 2. WHAT IS WRONG!!! Private Sub Command1_Click() Dim port port = InputBox( (If this comment was disrespectful, please report it (#) .)

7/31/2002 1:16:38 PM: DrDre (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=3318194692&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

InputBox("What port do you want to host on?") Winsock1.LocalPort = port Winsock1.Listen End Sub (If this comment was disrespectful, please report it (#) .)

8/11/2002 5:48:55 AM: jozo (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=5534053554&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

the code is neat, but i have problems compiling it. Something lik argument not optional in the Data=winsock1.Getdata line When i click winsock icon i get only this Winsock_error sub. No sign of recieve data or connection request. Am i missing something here? thanks here what is on my winsock icon: Private Sub Winsock1_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean) End Sub (If this comment was disrespectful, please report it (#) .)

8/20/2002 10:37:46 AM: Kurt (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=6636852895&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Great Tutorial, definately helped alot! (If this comment was disrespectful, please report it (#) .)

8/23/2002 12:09:33 PM: skad0g (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=227974021&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

it says "Wrong Protocol or Connection State" (If this comment was disrespectful, please report it (#) .)

9/4/2002 12:29:21 PM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=5529697524&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Wow, that's a great tutorial, for the people that get question marks and blank boxes, you must remember to place it in the Winsock1_DataArrival, like this: Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long) Winsock1.GetData Data MsgBox Data End Sub (If this comment was disrespectful, please report it (#) .)

9/5/2002 12:18:43 PM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=6638517285&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Good job! I used to be stuck using a UDP connection. Now TCP is easy to use! Thanks! (If this comment was disrespectful, please report it (#) .)

9/7/2002 11:49:23 AM: Wouter Lievens (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=2211487391&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Not explained badly, but placing it in intermediate category is lame. Stuff that would belong in intermediate is a full multi user system with automatic timeouts and pinging. Stuff that would belong in Advanced would be a full PeerToPeer application that does graph searching for the most efficient connection and all that. So if you would have put this in Beginner I would have given 3 or 4. In Intermediate it deserves only 1. (If this comment was disrespectful, please report it (#) .)

9/7/2002 11:59:31 AM: Matt Carpenter (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=3315126102&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Isn't the level stuff for the CODER not the CODE? Notice when you post the code, next to the 'expert' radio button, it says ( 1+ years) That would be for the coder :-/ (If this comment was disrespectful, please report it (#) .)

9/7/2002 10:43:37 PM: Jeremiah Ng (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=5533460304&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Very easy to understand winsock control do you have any tutorial as simple as this and has multi client connections?? or any other winsock server and client tutorial??? Please help me thankz.... email me... (If this comment was disrespectful, please report it (#) .)

www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=30413&lngWId=1

7/13

4/4/13
10/13/2002 6:20:38 PM:
(http://domain.com/vb/feedback/EmailUser.asp?

__Simple Winsock Tutorial__ by Matt Carpenter

lngWId=1&lngToP ersonId=6641723705&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

OK, first. I really appreciate your taking the time to write this down and try to help those of us who don't know these basics. I did learn from you and that counts. Not to be mean or to sound ungreatful, but I wish you would have taken just a bit more time to try to ensure that your code needed no modification. That would have saved me a lot of time from having to delve through the responses to locate the corrections. No biggie though. I learned a lot and you as well as those who offered additional help via their comments have my gratitude. Thanks. (If this comment was disrespectful, please report it (#) .)

10/23/2002 8:35:34 AM: Logix (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=331868522&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

very nice (If this comment was disrespectful, please report it (#) .)

11/8/2002 7:10:41 PM: Patabugen (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=7743392966&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Thank you so much for being simple. Ive been trying 2 learn Winsock for ages but all i have found is "Advanced Winsock" and "Multi User Chats" nothing which just tells me how it works :) Thanx again! (and thanks to everyone who posted about that mindor error!) (If this comment was disrespectful, please report it (#) .)

11/15/2002 11:58:22 AM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=7742161386&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

I compare with some users, that there was some problems, but I've solved it with a little help of solutions already existing here ;P really simple and powerful. And, I'm soryy I don't believe You're really 13;) . Actually I'm 14 :D (If this comment was disrespectful, please report it (#) .)

12/2/2002 9:42:24 AM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=7743798686&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Thanx. This code realy helped me. (If this comment was disrespectful, please report it (#) .)

12/18/2002 12:41:28 AM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=6635008535&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

gave me a nice hint then i found out what to do... might be missing a few things :) i made a chat program and got it to work after a few hours of messing around (If this comment was disrespectful, please report it (#) .)

12/21/2002 10:14:02 AM: Ricky Casavecchia (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=6641814005&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

i think there is something wrong with my winsock thing but when ever i run the program and try to host it says error so i click debug and it hilights winsock1.listen it does this everytime i use winsock does anyone know whats wrong? (If this comment was disrespectful, please report it (#) .)

12/27/2002 8:08:14 AM: Marvin Hufford (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=5532342474&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Your code does not work because the command, if winsock1.state <> sckclosed then winsock1.close, always closes the winsock. I agree with Mystins in that you need an array for the winsock in the host (not the client) so that there is one element of the array (an instance) for listening and one element for each client. Suggestion: Put a 0 for the Index in the property menu. Then, your code for the host could include, Winsock(0).localport = Port, and Winsock(0).Listen. Also add, Load winsock(1), before the line: winsock(1).accept RequestID. Make other code changes so the host winsock is winsock(num) (depending on the winsock caption) and the client winsock remains as winsock1. (If this comment was disrespectful, please report it (#) .)

12/28/2002 1:41:45 AM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=7747769366&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

supoose if in client server-application client is under proxy. then how can client connect to server through proxy.. (If this comment was disrespectful, please report it (#) .)

1/11/2003 6:59:13 PM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=5530896134&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

everytime i try to put this all together it works but when i run it and goto connect to my self (after doing the listen on a diffrent one) i get a runtime error 13 type mismatch and im putting in 127.0.0.1 and when i put in 127001 it works but crashes after wards ... whats wrong? i did everything right (If this comment was disrespectful, please report it (#) .)

2/8/2003 4:58:03 AM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=8851158947&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

ok my problem is simple im making a program using upto to 10 winsocks i get them all to logon but when i try to send any data it causes a protocol errori use a diff port for aech winsock so if you know what im doing wrong or if i need to index the winsocks please email me with your idea .....ur advice was simple to the point and easy to understand although some changes were needed to make ur example work i give u a 6 but keep up the good work :) (If this comment was disrespectful, please report it (#) .)

2/22/2003 10:43:35 PM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=8852347477&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Hi I was wondering if there is any tutorials anywhere on how to create a chat or media desktop program like (If this comment was disrespectful, please report it (#) .)

3/18/2003 11:33:35 PM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=7747509386&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

I dont mean to be a bad guy, but im bein hounest. this tutorail is wrong. i dont no why but it is. please if any one knows how to teach a good way to make a game using winsock. e-mail me (If this comment was disrespectful, please report it (#) .)

3/19/2003 12:20:29 AM: Matt Carpenter (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=3315126102&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Note to all: Im sorry about the error in this code that everybody's been complaining about. I dumped visual basic a long time ago and I had forgotten all about this article until I started recieving emails notifing me about the comments. I'll attempt to change this code right now, but those who say that they can't get it to work should've read through the comments because I belive somewhere in there I posted a fix. (If this comment was disrespectful, please report it (#) .)

3/22/2003 9:19:57 AM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=8853413367&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Nice,.. had to define data, host, port as string to make it work. Np's otherwise (If this comment was disrespectful, please report it (#) .)

4/8/2003 10:34:51 PM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=195958448&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

DUDE THIS TUTORIAL ROCKS! i have tried to learn winsock by reading through source but it was all too complicated- this tutorial is great! i give u a 10/10 (If this comment was disrespectful, please report it (#) .)

4/16/2003 6:06:33 AM: Ali Damji (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=7746083556&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=30413&lngWId=1

8/13

4/4/13
Great tutorial......easy to understand. (If this comment was disrespectful, please report it (#) .)

__Simple Winsock Tutorial__ by Matt Carpenter

4/20/2003 4:30:51 PM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=8852516457&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

i cant add the winsock control to my project what should i do when i try i get this error licence information for componet not found or something like that how can i fix this?????? (If this comment was disrespectful, please report it (#) .)

5/10/2003 12:25:10 AM: Teena417 (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=6641195695&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

plz how can i connect many people using winsock.... Please send me a example.... With Love And Prayer Teena417@yahoo.com (If this comment was disrespectful, please report it (#) .)

6/5/2003 8:55:58 AM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=1960277818&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

I like the mannor of teaching applied here. However I get a run time error. It's due to the fact that 'winsock1_RecieveData' Doesnt exist in my 6.0 version. the closest thing that was there was 'winsock1_DataArrivel'. This disapointed me. :( (If this comment was disrespectful, please report it (#) .)

6/5/2003 9:28:47 AM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=1960277818&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Hummm. I ended that poorly. I like the concept, and I'm not trying to criticize. But merely offer constructive feedback. You should (if you don't) make sure to check and follow up with these posts. If you're going to start such an endevor, you must follow through. However. Don't let negitive posts discourage you from continuing in your quest. Kevin Innovation Dynamics (If this comment was disrespectful, please report it (#) .)

6/11/2003 1:10:45 AM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=1960650988&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

how do i add a port to the form? (If this comment was disrespectful, please report it (#) .)

6/21/2003 8:29:43 AM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=5528367664&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

great tutorial, straight to the point. Well done. (If this comment was disrespectful, please report it (#) .)

7/11/2003 12:54:19 AM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=6637841855&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

when i go to add the winsock component, and add it to the thing, it says "License for this component not found. You do not have an appropriate license to use this functionally in a design environment." ... (i have dsl) does anyone know y this is doing that and what to do? (If this comment was disrespectful, please report it (#) .)

7/16/2003 2:26:32 PM: Patabugen- (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=7748998636&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

nice tutorial. short and useful! could have done with a bit more checking before posting tho. (If this comment was disrespectful, please report it (#) .)

7/27/2003 6:39:34 AM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=5530752634&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

I have a problem with Winsock. I'm trying to send SERVERNAME and MESSAGEOFTHEDAY to the client when it connects. The only problem is that they get mixed up together. The code is Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long) If Winsock1.State <> sckClosed Then Winsock1.Close Winsock1.Accept requestID messageoftheday = text99.Text servername = Text2.Text Winsock1.SendData servername Winsock1.SendData messageoftheday End Sub Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long) Winsock1.GetData servername, vbString, bytesTotal Form2.Caption = "SockChat Alpha -> Connected to " & servername Winsock1.GetData messageoftheday, vbString, bytesTotal rtf.Text = rtf.Text & messageoftheday + vbNewLine End Sub help? :PP (If this comment was disrespectful, please report it (#) .)

8/1/2003 2:57:38 AM: Elias Coronado Meza (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=8849753137&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

wow it really helped me a lot Thanks ! ;) (If this comment was disrespectful, please report it (#) .)

8/9/2003 12:10:14 AM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=1958623368&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

cool now i know how to use this thingy well one of its functions anyway thanks man (If this comment was disrespectful, please report it (#) .)

8/20/2003 7:57:30 PM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=3314869622&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Reply to; Winsock Licence error. You have the VB5 Learning Eddition more than likely. You should get prof ver. It means exactly what it says, your stripped version isnt licenced to use certain advanced tools. (If this comment was disrespectful, please report it (#) .)

8/26/2003 4:54:15 AM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=2165807089&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

hi i'm a beginner to vb and just now learning about the controls. i read this article and tried it but i receive an error message lime "Address already in use". i don't know where i went wrong and try to help me. And also i want to know how files can be exchanged b/w networks. Thanks in advance. (If this comment was disrespectful, please report it (#) .)

8/30/2003 12:18:22 AM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=2166109489&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Was having trouble keeping a connection after the request was received by my local winsock. Then I looked at your code and realized what I forgot. I love ya man! 5 Globules. (If this comment was disrespectful, please report it (#) .)

9/3/2003 4:29:24 PM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=2165339839&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=30413&lngWId=1

9/13

4/4/13

__Simple Winsock Tutorial__ by Matt Carpenter

This code worked beautifully and was just the kick in the butt I needed to start understanding winsock! (If this comment was disrespectful, please report it (#) .)

9/26/2003 4:46:23 PM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=7745808456&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

I wrote like this: Winsock1.GetData(Data, vbString, bytesTotal) = GetData MsgBox Data (If this comment was disrespectful, please report it (#) .)

9/28/2003 1:24:35 AM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=1962328328&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

nice :) thanks. 5 from me (If this comment was disrespectful, please report it (#) .)

9/28/2003 6:33:19 AM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=5528764704&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Thanks heaps buddy! :) (If this comment was disrespectful, please report it (#) .)

12/4/2003 2:54:33 AM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=2272984141&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

[very]^infinity good tutorial..... This is what u call as a tuturial (If this comment was disrespectful, please report it (#) .)

1/27/2004 6:30:15 PM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=2274901091&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

know anything about ms flexy grids? (If this comment was disrespectful, please report it (#) .)

2/14/2004 8:19:48 PM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=2276518371&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

i dont get it. the bit i dont understand is: Now, double click the Winsock control and go to the sub 'winsock1_ConnectionRequest'. Under that ' , put this code. please explain where that is.. (If this comment was disrespectful, please report it (#) .)

2/20/2004 9:37:48 PM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=2276620571&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

yea! i dont get that part either!!! i am so confused!! how do u get there? (If this comment was disrespectful, please report it (#) .)

2/21/2004 11:18:38 AM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=2278659041&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

HoW the HELL can i add winsock to my form?!?!?!?!?!?!?!??!?!?!?!?!? i almost lost my mind ... i checked every thing and i still dont cnow how to do it :P (If this comment was disrespectful, please report it (#) .)

2/21/2004 6:10:08 PM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=2276620571&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

im pretty sure u have to add it through components, but i dont see where hes talkin bout wit the "subs" (If this comment was disrespectful, please report it (#) .)

2/24/2004 3:08:30 PM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=2167675319&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Congratulations man :) Very good Work. Keep Coding!!! (If this comment was disrespectful, please report it (#) .)

3/6/2004 12:23:33 AM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=2279785061&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

This worked great when doing it between myself on my computer, however when i copied it to another computer (win2k, sp4) and tried to run it it came back the error "Component"MSWINSCK.OCX" or one of its dependencies not correctly registered: a file is missing or invalid" any help would be appreciated (If this comment was disrespectful, please report it (#) .)

3/10/2004 3:24:27 AM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=2168048769&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Keep sending more tutorials like this, for us newbies to familiarize ourselves with. (If this comment was disrespectful, please report it (#) .)

5/20/2004 7:13:09 AM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=2285309811&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Runtime error '13' appears. Where's the bug? (If this comment was disrespectful, please report it (#) .)

9/15/2004 1:03:10 AM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=2169997639&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

sdfsd (If this comment was disrespectful, please report it (#) .)

9/29/2004 7:54:03 PM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=2280049521&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

keeps making me crash i have vb6 sp6b (If this comment was disrespectful, please report it (#) .)

10/22/2004 12:38:46 PM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=2282341951&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

If you get the error: "Component"MSWINSCK.OCX" or one of its dependencies not correctly registered: a file is missing or invalid" It means that the computer that you copied the file to doesn't have MSWINSCK.OCX. The best way I found to get around that is to create an install file for the program using the P&D Wizard that came with VB6. Upon running your setup file, it will automatically install the ocx and you shouldn't have any problems. (If this comment was disrespectful, please report it (#) .)

11/22/2004 5:17:20 AM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=2296627621&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Nice tutorial on WinSock basics. Good for new programmers. Thanx a lot :-) (If this comment was disrespectful, please report it (#) .)

www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=30413&lngWId=1

10/13

4/4/13
1/25/2005 3:57:12 PM:
(http://domain.com/vb/feedback/EmailUser.asp?

__Simple Winsock Tutorial__ by Matt Carpenter

lngWId=1&lngToP ersonId=22100297651&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

IT'S A GREATFUL PROGRAMS.THANKS FOR THE AUTHOR.IT'S GR8 (If this comment was disrespectful, please report it (#) .)

2/15/2005 11:27:57 PM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=4424472613&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Now, double click the Winsock control and go to the sub 'winsock1_ConnectionRequest'. Under that ' , put this code. When double clicking on the component it does not work like the above .... (If this comment was disrespectful, please report it (#) .)

3/14/2005 11:25:36 AM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=22103958651&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

MOST OF THE ARTICLES IN WEBSITE ARE VERY INTERESTING AND USEFULONE THING WHICH I CANNOT UNDERSTAND IS--CAN WINSOCK CONTROL BE USED OVER WIDER AREA NETWORK WITHOT ANY CONNECTION TO THE INTERNET (If this comment was disrespectful, please report it (#) .)

3/14/2005 11:29:13 AM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=22103958651&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

most of the sites in this article are very interesting and useful.one thing which i cant understand is can winsock control be used over a wide area network without any connection to the internet.i would appreciate if you would kindly take the trouble to provide some information on this issue (If this comment was disrespectful, please report it (#) .)

3/14/2005 11:32:53 AM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=22103958651&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Thank you very much for your keen response to reader's feedback and helpful intention (If this comment was disrespectful, please report it (#) .)

4/19/2005 8:11:14 AM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=22105707671&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Thanks alot, it really helped me :P (If this comment was disrespectful, please report it (#) .)

5/4/2005 6:25:55 AM: sSoftware (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=2277512581&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

As we all know .. winsock can help us connect on irc .. but i have a question : i am working on a irc client and i need to connect through a proxy to a ircserver ( like mirc does ) . Are there any suggestions how to do this ? (If this comment was disrespectful, please report it (#) .)

6/21/2005 2:38:43 AM:


Keep getting the same errors.... Run-time error '40020' Invalid operation at current state ' This is when I try to connect Run-time error '13': Type mismatch 'When I try to host

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=2293804801&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

Run-time error '40006' Wrong protocol or connection state for the requested transaction or request. 'When I try to send Any ideas? Defilar@hotmail.com hotmailmemberservices@hotmail.com (If this comment was disrespectful, please report it (#) .)

8/15/2005 9:55:01 PM:

(http://domain.com/vb/feedback/EmailUser.asp?

lngWId=1&lngToP ersonId=22113016091&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

thank you for your tutorial (If this comment was disrespectful, please report it (#) .)

10/4/2005 12:26:08 PM: leo (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=22117121311&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

help me about winsock (If this comment was disrespectful, please report it (#) .)

10/8/2005 5:45:41 PM: sarmenhb (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=6640638215&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

wow this tutorial is old.. i like it.. (If this comment was disrespectful, please report it (#) .)

1/10/2006 6:46:02 PM: nobiy (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=22122115181&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

pretty useful, i think i get some of it now. (If this comment was disrespectful, please report it (#) .)

10/3/2007 8:30:40 AM: ali (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=77469984026&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

vb 6 (If this comment was disrespectful, please report it (#) .)

6/18/2008 9:56:54 AM: trixdhy (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=77486436126&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

i Really Like Vb and this tutorial is works for me to know how winsock works in programming....ex like send and read email...thank's... (If this comment was disrespectful, please report it (#) .)

1/17/2010 5:23:39 AM: jigs (http://domain.com/vb/feedback/EmailUser.asp?


lngWId=1&lngToP ersonId=77488116896&txtReferralP age=http%3A%2F%2Fwww%2Eplanet%2Dsource%2Dcode%2Ecom%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1)

great (If this comment was disrespectful, please report it (#) .)

Add Your Feedback


Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular article, please click here (http://domain.com/vb/feedback/feedback.asp?lngWId=1&intTypeOfInquiry=3) instead.)

www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=30413&lngWId=1

11/13

4/4/13

__Simple Winsock Tutorial__ by Matt Carpenter


To post feedback, first please login (http://domain.com/vb/authentication/Login.asp? lngWId=1&txtReturnURL=%2Fvb%2Fscripts%2FShowCode%2Easp%3FtxtCodeId%3D30413%26lngWId%3D1#AddYourFeedback) .

Quick search for


Search for Search for
Visual Basic Search

Please give us your details and a Citibank representative w ill get in touch w ith you shortly.
* All f ields are mandatory

First Name* Last Name* Mobile Number* Date of Birth*

: First Name : Last Name : DD YYYY MM

City of : Select Residence* Email ID* : Profession* Annual Income* : Salaried

* Terms & Conditions apply Priv acy policy

Newest postings for Visual Basic.

Add this ticker to my site (http://domain.com/vb/LinkToUs/default.asp?lngWId=1#NewCodeTicker)

Daily(http://domain.com/Upload_PSC/ScreenShots/PIC2013411157143305.jpg) code email


(javascript:ShowPopupWindowXYWithScrollbars('/vb/misc/NewUpdateIconExplanation.asp',200,300))
account & inventory system
(http://domain.com/vb/scripts/S howCode.asp? txtCodeId=74745&lngWId=1) (http://domain.com/vb/CodeOfTheDay/signup.asp?

Click here to join the 'Code of the Day' mailing list


(http://domain.com/vb/CodeOfTheDay/signup.asp?lngWId=1) !

lngWId=1)

By ajaykumar bhanuprasad patel on This 4/1 site on CD (Screen Shot


(http://domain.com/Upload_PSC/ScreenShots/PIC2013411157143305.jpg)

)
(http://www.exhedra.com/exhedra/PlanetSourceCode/CD.aspx) (http://domain.com/Upload_PSC/ScreenShots/PIC201341519109279.JPG)

Over 7,000 submissions on a super fast CD


(http://www.exhedra.com/exhedra/PlanetSourceCode/CD.aspx) !

(javascript:ShowPopupWindowXYWithScrollbars('/vb/misc/NewUpdateIconExplanation.asp',200,300))

About (http://domain.com/vb/about/AboutTheSiteAndAuthor.asp?lngWId=1)
DailyPicma

www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=30413&lngWId=1

12/13

4/4/13

__Simple Winsock Tutorial__ by Matt Carpenter

Contact (http://domain.com/vb/feedback/feedback.asp?lngWId=1) Awards (http://domain.com/vb/about/Awards.asp?lngWId=1) Link to us (http://domain.com/vb/LinkToUs/default.asp?lngWId=1) Privacy (http://domain.com/vb/scripts/privacy.asp?lngWId=1) Advertising (http://domain.com/vb/advertisement/scripts/rates.asp?lngWId=1)

Code/Articles Newest (http://domain.com/vb/scripts/BrowseCategoryOrSearchResults.asp?


grpCategories=-1&optSort=DateDescending&txtMaxNumberOfEntriesPerPage=10&blnNewestCode=TRUE&blnResetAllVariables=TRUE&lngWId=1) Browse categories (http://domain.com/vb/scripts/BrowseAllCategories.asp?lngWId=1) Search (http://domain.com/vb/scripts/search.asp?lngWId=1) Upload code / articles (http://domain.com/vb/authors/determine_author_type.asp?lngWId=1) Open letter from moderators (http://domain.com/vb/misc/OpenLetterFromPSCModerators.asp?lngWId=1) Articles & tutorials (http://domain.com/vb/Tutorial/default.asp?lngWId=1) Recommended reading (http://domain.com/vb/Bookstore/default.asp?lngWId=1)

Top Code Coding contest (http://domain.com/vb/contest/ContestInfo.asp?lngWId=1) Coding contest leader board (http://domain.com/vb/contest/ContestAndLeaderBoard.asp?lngWId=1) Coding contest 'All-Time Hall of Fame' (http://domain.com/vb/scripts/BrowseCategoryOrSearchResults.asp?
grpCategories=-1&txtMaxNumberOfEntriesPerPage=10&blnTopCode=True&blnResetAllVariables=TRUE&lngWId=1) Code of the day newsletter (http://domain.com/vb/CodeOfTheDay/signup.asp?lngWId=1)

Community Ask a pro discussion forum (http://domain.com/vb/discussion/default.asp?lngWId=1) Games (http://www.vWorker.com/RentACoder/DotNet/misc/Games.aspx?lngWId=1) Code of the day newsletter (http://domain.com/vb/CodeOfTheDay/signup.asp?lngWId=1) Jobs Search for a job (http://domain.com/vb/jobs/SearchJobs.asp?lngWId=1) Post a job (http://domain.com/vb/jobs/PostJob.asp?lngWId=1) Other My profile (http://domain.com/vb/authentication/MyPlanetSourceCode/CustomizeInfo.asp?lngWId=1) How to link to us (http://domain.com/vb/LinkToUs/default.asp?lngWId=1) Awards/Reviews/Raves! (http://domain.com/vb/about/Awards.asp?lngWId=1) Advertising/Media kit (http://domain.com/vb/advertisement/scripts/rates.asp?lngWId=1) Feedback (http://domain.com/vb/feedback/feedback.asp?lngWId=1) About the site (http://domain.com/vb/about/AboutTheSiteAndAuthor.asp?lngWId=1) Goto Visual Basic home (http://domain.com/vb/default.asp?lngWId=1) Site home (http://domain.com/PlanetSourceCode/default.asp?lngWId=-1) Other sites (http://domain.com/vb/scripts/OtherLinks.asp?lngWId=1)

(http://domain.com/URLSEO/entrancegeneric/ShowWorldSeOnly!asp/lngWId!1/anyname.htm) (http://domain.com/URLSEO/vb Copyright 1997-2013 by Exhedra Solutions, Inc. (http://www.exhedra.com/) All Rights Reserved. By using this site you agree to its Terms and Conditions (http://domain.com/vb/scripts/TermsAndConditions.asp?lngWId=1) . Planet Source Code and the phrase "Dream It. Code It" are trademarks of Exhedra Solutions, Inc. (http://www.exhedra.com/)

www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=30413&lngWId=1

13/13

S-ar putea să vă placă și