EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Multiple Clients With Same IP

Also by EldoS: BizCrypto
Components for BizTalk® and SQL Server® Integration Services that let you securely store and transfer information in your business automation solutions.
Posted: 05/25/2007 07:28:32
by Adam Leyshon (Standard support level)
Joined: 05/08/2007
Posts: 23

Just a question, If I have 2 Clients connected to a server but have the same external IP (i.e.Router) and want to send a message to one of them does MsgConnect send it to both computers? (TCP Sockets)

Client 1 Socket: -> Server
Client 2 Socket: -> Server
Server -> Client 1
Server -> Client 2

or just
Server -> Client 1 because its the first one connected
Posted: 05/25/2007 07:57:10
by Adam Leyshon (Standard support level)
Joined: 05/08/2007
Posts: 23

OK, I've got more info that may be of use.
In my program I have a Hash table that stores the Hash of the computer name and the IP:Port associated in a table like this:
12312312  |C1,123.123.123,5405
45645645  |C2,123.123.123,5405


What I need to do is send a message (e.g. "RESULTS:")
to the computer that requested it.
I have already sent the result (Args.Message.Result = 10) meaning that the request has been acknowledged.

and to do a lookup I use:
  If Computers.ContainsKey(Computer) = True Then
    'If it does get the IP
    ComputerData = Split(CStr(Computers.Item(Computer)), ",")
    Dim Client As String = "Socket:" & ComputerData(1) & ":14583|KeepAlive"
  End If
Catch ex As Exception
End Try
Posted: 05/25/2007 08:26:17
by Eugene Mayevski (EldoS Corp.)

Your server sends delayed replies, doesn't it?
In this case you need to save the client's address when you receive the original request. Use GetMessageSource to obtain the address which can be used later to reply to this particular client. This address is not just an IP:Port, but also a couple of magic numbers which will help MsgConnect identify the client.

Sincerely yours
Eugene Mayevski
Posted: 05/25/2007 10:02:57
by Adam Leyshon (Standard support level)
Joined: 05/08/2007
Posts: 23

When I Save then Source Address I get this:
ComputerData = McMessenger1.GetMessageSource(MSG)
which gives "Socket:3:3:"

Now when I Do MCMessenger1.PostMessage(ComputerData, Msg, MonCreds) I get Bad destination format.

What am I supposed to do with the message source? parse it?
Posted: 05/25/2007 10:42:21
by Eugene Mayevski (EldoS Corp.)

You missed the QueueName part of the address. When you call PostMessage, your address must include ComputerData followed by the separator and the queue name.

Sincerely yours
Eugene Mayevski
Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages



Topic viewed 4248 times

Number of guests: 2, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!