Multiple Connections in Winsock -_-;
Multiple Connections in Winsock -_-;
Multiple Connections in Winsock -_-;
Multiple Connections in Winsock -_-;
Multiple Connections in Winsock -_-;
Multiple Connections in Winsock -_-; Multiple Connections in Winsock -_-; Multiple Connections in Winsock -_-; Multiple Connections in Winsock -_-; Multiple Connections in Winsock -_-; Multiple Connections in Winsock -_-; Multiple Connections in Winsock -_-; Multiple Connections in Winsock -_-;
Multiple Connections in Winsock -_-; Multiple Connections in Winsock -_-;
Multiple Connections in Winsock -_-;
Go Back  Xtreme Visual Basic Talk > > > Multiple Connections in Winsock -_-;


Reply
 
Thread Tools Display Modes
  #1  
Old 12-30-2002, 05:56 PM
Chrono23's Avatar
Chrono23 Chrono23 is offline
Junior Contributor
 
Join Date: Sep 2002
Location: Inside your head
Posts: 242
Red face Multiple Connections in Winsock -_-;


Yeah, I be this is brought up a lot on the forums, but how do you ake multiple connections using a winsock control array. Also, how do you check to see if any that are already loaded are not being used? I looked at WinsockVB.com but it just confused me.
__________________
Why is there war, famine and poverty in the world? Here's my answer: ¯\(°_o)/¯

Yes, I made my own avatar. And no, I'm not going to make one for you.... sorry.

Last edited by Chrono23; 12-30-2002 at 08:22 PM.
Reply With Quote
  #2  
Old 12-30-2002, 06:26 PM
OnErr0r's Avatar
OnErr0rMultiple Connections in Winsock -_-; OnErr0r is offline
Obsessive OPtimizer

Administrator
* Guru *
 
Join Date: Jun 2002
Location: Debug Window
Posts: 13,774
Default

Add one instance of the control to your form at design time. Load new instances in the ConnectionRequest event and accept on them. Do not accept on the original instance, it will always be listening.

You can enum the control array with a For/Each loop and "fill-in" holes in the array. Or use a parallel array to keep track.
__________________
Quis custodiet ipsos custodues.
Reply With Quote
  #3  
Old 12-30-2002, 06:27 PM
Chrono23's Avatar
Chrono23 Chrono23 is offline
Junior Contributor
 
Join Date: Sep 2002
Location: Inside your head
Posts: 242
Default

Er.... that was the problem. I don't know how to do any of that.
__________________
Why is there war, famine and poverty in the world? Here's my answer: ¯\(°_o)/¯

Yes, I made my own avatar. And no, I'm not going to make one for you.... sorry.
Reply With Quote
  #4  
Old 12-30-2002, 07:15 PM
aaa aaa is offline
Junior Contributor
 
Join Date: Jul 2002
Posts: 312
Default

well there were 2 tutorials on the winsockvb site that showed me how to do it.

All you basically need to know is how to use arrays with objects eg command buttons

after that just look a the tutorial on winsockvb
Reply With Quote
  #5  
Old 12-30-2002, 07:28 PM
Chrono23's Avatar
Chrono23 Chrono23 is offline
Junior Contributor
 
Join Date: Sep 2002
Location: Inside your head
Posts: 242
Default

Then how do i make a parallel boolean array? What kind of commands do I need to use. Acutal Code please.
__________________
Why is there war, famine and poverty in the world? Here's my answer: ¯\(°_o)/¯

Yes, I made my own avatar. And no, I'm not going to make one for you.... sorry.
Reply With Quote
  #6  
Old 12-30-2002, 10:52 PM
OnErr0r's Avatar
OnErr0rMultiple Connections in Winsock -_-; OnErr0r is offline
Obsessive OPtimizer

Administrator
* Guru *
 
Join Date: Jun 2002
Location: Debug Window
Posts: 13,774
Default

Dim foo() as Boolean

Redim foo(1 to NumberOfElementsDesired) ' or zero based if you control array is zero based too.

Where the number of elements you want is the current high index of the control array. Control array elements which have been unloaded are equal to false, and loaded ones are equal to true.
__________________
Quis custodiet ipsos custodues.
Reply With Quote
  #7  
Old 01-10-2003, 12:56 PM
jsharbour
Guest
 
Posts: n/a
Default Re: Multiple Connections in Winsock -_-;

Chrono, here is a zip with some sources that will show you how to use a winsock control array to make a client/server chat program. You can adapt the code for a game, if you want, although the code isn't very fast.
Attached Files
File Type: zip socketchat.zip (37.1 KB, 37 views)
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
Multiple Connections in Winsock -_-;
Multiple Connections in Winsock -_-;
Multiple Connections in Winsock -_-; Multiple Connections in Winsock -_-;
Multiple Connections in Winsock -_-;
Multiple Connections in Winsock -_-;
Multiple Connections in Winsock -_-; Multiple Connections in Winsock -_-; Multiple Connections in Winsock -_-; Multiple Connections in Winsock -_-; Multiple Connections in Winsock -_-; Multiple Connections in Winsock -_-; Multiple Connections in Winsock -_-;
Multiple Connections in Winsock -_-;
Multiple Connections in Winsock -_-;
 
Multiple Connections in Winsock -_-;
Multiple Connections in Winsock -_-;
 
-->