|
-
May 31st, 2000, 06:07 AM
#1
Thread Starter
Member
I need to know how to make multiple client connections to one server with winsock.
I did have a print out from the visual basic books on line thing but I've lost it.
If anyone has the book thingy please copy/paste that section into this forum. Or anyone godly enought to know how to solve my prog PLEASE HELP!
-
May 31st, 2000, 06:28 AM
#2
PowerPoster
Its not that hard, you load a new winsock when receiving a new connection request and connect at port 0.
If you need code you can download a chat demo from my website.
-
May 31st, 2000, 06:39 AM
#3
Thread Starter
Member
Are yes,
I though it'd come down to loading objects, somthing I've never done before.
I've only been writeing VB for about 8 months and the 3 or 4 programs I've done have been complex but basicaly Qbasic code in a button with a few text box's.
Help on loading Objects would be nice (and why port 0?)
-
May 31st, 2000, 07:13 AM
#4
I think you can do it like this
Code:
Dim MeMe As Winsock
-
May 31st, 2000, 07:28 AM
#5
PowerPoster
You set the index property of the winsock to 0 and load them by index:
Code:
Count as Long
onConnectionRequest()
Count = Count + 1
Load Winsock(Count)
Winsock(Count).AcceptID
End Sub
Port 0 automatically connects with a free port so you can use your port for more connections. Else after the first connection the port would be blocked... (or something, Im not that sure but I think its that)
-
May 31st, 2000, 07:39 AM
#6
PowerPoster
Create a new instant is the faster solution. (I think So)
Properly you can have 2 form:
frmMain.frm >> Consits of a WinSock Control.
frmWSck.frm >> Also Consits of a Winsock Control.
Set thr frmMain.frm as you startup form. So when ever the Winsock control in the frmMain.frm received as Connection Request then it create a new instant for the frmWSck.frm and therefore, you'll have a multiple Winsock connection.
Code:
'Under the frmMain.frm Winsock control
Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
Dim nWsck As New frmWSck
Load nWsck
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|