Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Communications > How do I reset / restart a Winsock control?


Reply
 
Thread Tools Display Modes
  #1  
Old 05-21-2006, 10:39 AM
kungfu71186 kungfu71186 is offline
Freshman
 
Join Date: Apr 2004
Posts: 32
Default


Edit by Moderator: Start your own threads please


Question about the winsock array. Ive seen people make controls on the form where its only winsock(0) then in the code they will open multiple connections such as

for i = 1 to 100
winsock(i)
next i

So its like using 100 different connections. When i tried that, make a control on the form and making it into an array and just called winsock(0), it says that its out of bounds because that control doesnt exist. What special things do you need to do to get this to work.

Last edited by reboot; 05-21-2006 at 12:17 PM.
Reply With Quote
  #2  
Old 05-21-2006, 10:55 AM
x3no x3no is offline
Freshman
 
Join Date: Sep 2005
Posts: 25
Default

kungfu, are you putting a (variable) after each Winsock in your code? You have to specify the index for an array.

like Winsock(currentsock).senddata ("Hello World!") or
Code:
for z = 1 to 100
winsock(z).senddata mydata(z)
next z
EDIT:

To create a new Winsock, use Load. Ubound is the highest number in the array, take a look at my code
Reply With Quote
  #3  
Old 05-21-2006, 12:11 PM
kungfu71186 kungfu71186 is offline
Freshman
 
Join Date: Apr 2004
Posts: 32
Default

Quote:
Originally Posted by x3no
kungfu, are you putting a (variable) after each Winsock in your code? You have to specify the index for an array.

like Winsock(currentsock).senddata ("Hello World!") or
Code:
for z = 1 to 100
winsock(z).senddata mydata(z)
next z
EDIT:

To create a new Winsock, use Load. Ubound is the highest number in the array, take a look at my code
Ahhh ok thanks.
Reply With Quote
  #4  
Old 05-21-2006, 06:04 PM
x3no x3no is offline
Freshman
 
Join Date: Sep 2005
Posts: 25
Default

I got it to work! Thanks for the help.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->