server with multiple clients (General questions)
I create a datatable with the following columns ...
mTerminals = New DataTable
mTerminals.Columns.Add( Id , System.Type.GetType( System.String ))
mTerminals.Columns.Add( Mac , System.Type.GetType( System.String ))
mTerminals.Columns.Add( VPN , System.Type.GetType( System.Object ))
mTerminals.AcceptChanges()
I populate the datatable with my client, number of clients unkown.
For i = 0 To DT.Rows.Count - 1
Dim NewRow As DataRow = mTerminals.NewRow
NewRow.Item( Id ) = DT.Rows(i).Item( Id ).ToString
NewRow.Item( Mac ) = DT.Rows(i).Item( Mac ).ToString
Dim VPN As WODVPNCOMLib.wodVPNCom = New WODVPNCOMLib.wodVPNCom
AddHandler VPN.Connected, AddressOf Connected
AddHandler VPN.Disconnected, AddressOf Disconnected
AddHandler VPN.VPNRequest, AddressOf VPNRequest
NewRow.Item( VPN ) = VPN
mTerminals.Rows.Add(NewRow)
Next
I start my mediator listening ...
mMediator = New WODVPNCOMLib.wodVPNCom
mMediator.MyID = Mediator
mMediator.Password = anypass...
mMediator.Mediator.Start(SearchEnum.SrchUDPSingle, 1020)
Private Sub mMediator_MediatorConnected(ByVal IP As String, ByVal Port As Integer, ByVal FromID As String, ByVal ToID As String, ByVal Data As String, ByRef Allow As Boolean) Handles mMediator.MediatorConnected
For i As Integer = 0 To mTerminals.Rows.Count - 1
Dim Row as DataRow = mTerminals.Rows(i)
If FromID = Row.Item( Mac ).ToString Then
Dim VPN As WODVPNCOMLib.wodVPNCom = Row.Item( VPN )
VPN.Connect(IP, Port) ' How do I connect client
Exit For
End If
Next
End Sub
Is there some way of getting the mediator to connect these two objects??? ie the external wodVPN client which did the search and found the mediator and the modVPN in my datatable???
Regards
Re: server with multiple clients
Hi Drainey,
We can discuss your problems here. I deleted your posts on other topics.
Did you try maybe our samples? Maybe that will help you to start developing with wodVPN.
Did you use your mediator in Search Method? Does our samples works if you use your mediator?
Regards,
Drazen
Re: server with multiple clients
Drainey,
hi. I'm not sure I understand all of your code, but I can explain what you need to achieve. You need to set MyID property on both sides to values you would use while searching, and then use Search method to use other peer, and mediator will connect you. Is that your question?
Kreso