Visual Basic (Multiple Winsocks) [Archive] - SpeedGuide.net Broadband Community

View Full Version : Visual Basic (Multiple Winsocks)


Unregistered
04-03-02, 10:55 PM
To make a long story short, I'm having a problem using multiple Winsock controls to manage multiple connections over my program. The problem isn't that it doesn't work, actually it does, my problem is using multiple Winsocks.

I'm using a control array to to identify the individual connections (tcpServer). But I need to make a private sub to accept incoming connections:

------------------
Private Sub tcpServer_ConnectionRequest(ByVal RequestID as Long)
------------------


I can declare this sub if I'm using a single Winsock conrol, but not when they're in an Array form... I get an error message about the format of the Sub...

Anyone know what I can do about this?

-----------------------------------------------
Someone once told me how scary it was how much top-soil we lose each year to errosion. But I told that story around the campfire, and no one got scared.
-----------------------------------------------

Tryn
04-03-02, 11:36 PM
This site might help http://www.freevbcode.com/ShowCode.Asp?ID=137 I have never messed with networking in Vb so I hope it helps.






tryn

andymurray
04-10-02, 03:36 PM
When you draw your winsock control on your form and double click on it you should automatically be taken into the code editor which will (if you have set the index property to 0) print the following sub for you. If not, all you have to do is add "Index As Integar" to the sub.

Private Sub tcpServer_ConnectionRequest(Index As Integer, ByVal requestID As Long)

End Sub

Then just insert something like this into the body of the sub --tcpServer(Index).accept requestID

hope this is helpful

Andy