EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Parameters of GetMessageSource

Also by EldoS: Callback File System
Create virtual file systems and disks, expose and manage remote data as if they were files on the local disk.
#5145
Posted: 02/22/2008 12:45:10
by Michael Cone (Standard support level)
Joined: 02/12/2008
Posts: 8

Can you help me to determine what the first two values are in the string returned by the GetMessageSource function using a TCP/IP transport?

Your help files reads:
"The text that contains the part of the sender's address -- transport name and source address specific to the transport."

I know that the Transport name is something else (like Socket). But this is what we see:

2:1:192.168.1.13:14582

I'm interested in the "2" and the "1".

Sending from other multiple instances of this program using unique ports, I can see that the values change like this:
Send from Instance 2: 2:2
Send from Instance 3: 7:6
Send from Instance 4: 9:8

If not, then I can just parse around it to get to the IP and port.

Thanks,
Mike
#5146
Posted: 02/22/2008 12:47:32
by Michael Cone (Standard support level)
Joined: 02/12/2008
Posts: 8

Sorry about all the posts. Your forum doesn't appear to allow me to erase my other two messages.
#5147
Posted: 02/22/2008 13:00:15
by Eugene Mayevski (EldoS Corp.)

This question seems to have been explained in the forum before. The data returned by GetMessageSource is used for only one purpose - to send other message later using SendMessage or PostMessage. It's not intended to be treated as an IP:Port or as a source addrees. The reason for this is simple: if several clients are behind NAT, you will get the IP of the NAT and you will have no way to determine the real IPs anyway. And MsgConnect deals with this issue internally.


Sincerely yours
Eugene Mayevski
#5148
Posted: 02/22/2008 14:20:08
by Michael Cone (Standard support level)
Joined: 02/12/2008
Posts: 8

Eugene - Thanks for answering. Please understand that I am new to this and could not find an answer through search. If I am asking questions answered elsewhere, can you point me to them please?

Your response brings up another question:

I format SENT message address like this:
Socket:192.168.1.13:14582|SendQueue

The receiver of this message address sees this:
Socket:7:1:192.168.1.13:14582

I think you are saying that it is okay to use the received address as a sending address like this:

Messenger.SendMessageTimeoutCallback('Socket:7:1:192.168.1.13:14582|SendQueue', Message, 10000,
OnMessageSent, OnMessageTimeout, OnMessageError, Cardinal(Self), nil);

Is this the best way to return a message to the sender?

Also: I'm still interested in knowing what the two numbers undefined are. They appear to be some sort of temporary IDs.

Mike







#5149
Posted: 02/22/2008 14:42:50
by Eugene Mayevski (EldoS Corp.)

Quote
Michael Cone wrote:
I think you are saying that it is okay to use the received address as a sending address like this:

Messenger.SendMessageTime­outCallback('Socket:7:1:1­92.168.1.13:14582|SendQue­ue', Message, 10000,
OnMessageSent, OnMessageTimeout, OnMessageError, Cardinal(Self), nil);


Yes, this should work.

Quote
Michael Cone wrote:
Also: I'm still interested in knowing what the two numbers undefined are. They appear to be some sort of temporary IDs.


Yes, they are session IDs inside of the transport. There's a complex rule regarding how to dispatch messages based on those IDs, but everithing works so that the message doesn't go to the wrong connection if the initial connection is broken, but if the connection is re-established, then the message is sent. Hard do explain and even harder to code and debug :).


Sincerely yours
Eugene Mayevski
#5150
Posted: 02/22/2008 14:52:25
by Michael Cone (Standard support level)
Joined: 02/12/2008
Posts: 8

Eugene,

That answer is perfect.

Now you've impressed me. Frankly, MsgConnect is more powerful than I understood when I made the initial purchase. Initially I wasn't too sure if I should handle these kinds of communications myself using TCP/IP (which our old code already does), or use your component.

The more I work with your component, the more I can see that we made the right decision.

Thanks,
Mike
#5154
Posted: 02/24/2008 11:26:07
by Eugene Mayevski (EldoS Corp.)

Thank you :)


Sincerely yours
Eugene Mayevski
Also by EldoS: Callback File System
Create virtual file systems and disks, expose and manage remote data as if they were files on the local disk.

Reply

Statistics

Topic viewed 4424 times

Number of guests: 1, 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!