Bcoloutlaw
asked on
VB 6 Client/server program with multiple clients connected to one server.
I Have created a program for a user that uses "WINSOCK" to connect the client program to the server. The problem is that the user demands to have several clients to connect to one server. How do I make this several or multiple clients to one server? Do I have to Use multiple winsock? if I do, then I would have to open multiple ports and it would slow down the server. What should I use to connect multiple clients to this one server? thankz!
First set your winsock control's index value to 0 then
check this example.
Private intMax As Long
Private Sub Form_Load()
intMax = 0
sckServer(0).LocalPort = 1001
sckServer(0).Listen
End Sub
Private Sub sckServer_ConnectionReques
(Index As Integer, ByVal requestID As Long)
If Index = 0 Then
intMax = intMax + 1
Load sckServer(intMax)
sckServer(intMax).LocalPor
sckServer(intMax).Accept requestID
Load txtData(intMax)
End If
End Sub
Bcoloutlaw:
This old question needs to be finalized -- accept an answer, split points, or get a refund. For information on your options, please click here-> http:/help/closing.jsp#1
Experts: Post your closing recommendations! Who deserves points here?
This old question needs to be finalized -- accept an answer, split points, or get a refund. For information on your options, please click here-> http:/help/closing.jsp#1
Experts: Post your closing recommendations! Who deserves points here?
Bcoloutlaw, an EE Moderator will handle this for you.
Moderator, my recommended disposition is:
Save as PAQ -- No Refund.
DanRollins -- EE database cleanup volunteer
Moderator, my recommended disposition is:
Save as PAQ -- No Refund.
DanRollins -- EE database cleanup volunteer
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
private sub winsock1_connectionrequest
If Index = 0 Then
'// your code here
'// first connection to client
else
'// multiple client
varEnviron.SockMax = varEnviron.SockMax + 1
ReDim Preserve arrSockAvi(varEnviron.Sock
Load wskSocket(varEnviron.SockM
wskSocket(varEnviron.SockM
wskSocket(varEnviron.SockM
end if
end sub