EldoS | Feel safer!

Software components for data protection, secure storage and transfer

.NET SendNote UDP No Messages Received

Also by EldoS: SecureBlackbox
200+ components and classes for digital security, signing, encryption and secure networking.
#6749
Posted: 06/25/2008 18:09:02
by Tim Sullivan (Standard support level)
Joined: 06/25/2008
Posts: 26

I recently downloaded the .NET MsgConnect and started looking through the demos.
Using the SendNote, I compiled for UDP.
I set the destination IP to 255.255.255.255 for broadcast, and hit 'Send'.
The message was received in the mcQueue_OnUnhandledMessage event.
However, once the first message is received, no subsequent messages are received. It's almost as if the Queue is still waiting for a reply/confirmation.
If I set the Queue to incactive, then back to active, it will receive one message (as before).
Are there additional settings that need to be in place to be able to receive multiple UDP broadcasts?
Please let me know if you need more information.
Thanks.
#6754
Posted: 06/26/2008 05:35:02
by Eugene Mayevski (EldoS Corp.)

You don't need any additional settings. I will check the issue and let you know then. Please remind me tomorrow if I give no reply (too much work these days ...).


Sincerely yours
Eugene Mayevski
#6766
Posted: 06/27/2008 10:19:23
by Tim Sullivan (Standard support level)
Joined: 06/25/2008
Posts: 26

Hi Eugene,
I was wondering if you'd found anything out on the UDP issue?
Thanks.
#6768
Posted: 06/27/2008 12:40:48
by Eugene Mayevski (EldoS Corp.)

I've reproduced the issue. Now working on it.


Sincerely yours
Eugene Mayevski
#6769
Posted: 06/27/2008 12:58:43
by Eugene Mayevski (EldoS Corp.)

If you are building the assembly from source, you can fix the issue easily - in MCUDPSocket.cs find MCUDPReceiverThread.Execute() method and remove the call to Close() method in finally section of try/finally block. I have no idea how it got there.

If you use the shipped assemblies, please wait for an update, which is expected next week with MacOS X support for C++.


Sincerely yours
Eugene Mayevski
#6770
Posted: 06/27/2008 13:29:06
by Tim Sullivan (Standard support level)
Joined: 06/25/2008
Posts: 26

I recompiled the source dll.
I made the following change to MCUDPSocket.cs:
(line 1083) FRecvSocket.Close(false); => //FRecvSocket.Close(false);
With the new dll built into the SentNote example, I am now able to receive multiple UDP broadcasts.
However, now for each message I send (using PostMessage since UDP), I receive 3 identical messages.
For example:
Address: 255.255.255.255
Port: 14583
Message: Test Message

Hitting send will cause the app to receive message 3 times:
C# demo -> Test Message
C# demo -> Test Message
C# demo -> Test Message

Is this expected behavior with UDP (I'm fairly new to UDP/Broadcast)? Or is there another change I need to make?

Thanks for all your help.
#6771
Posted: 06/27/2008 13:44:44
by Eugene Mayevski (EldoS Corp.)

Yes, this happens because the message is sent via all available network interfaces. To be able to send only via specific interface, you need to adjust MessengerAddress property. For example, if you set it to 127.0.0.1, you should be able to receive only messages sent to localhost and also receive broadcasts once.


Sincerely yours
Eugene Mayevski
#6772
Posted: 06/27/2008 13:45:04
by Tim Sullivan (Standard support level)
Joined: 06/25/2008
Posts: 26

More Info:
I'm running SendNote on Two machines (My local xp64 and a VM XP 32).
Both machines are configured to broadcast using 255.255.255.255.
When I send a message using SendNote on my local machine, I receive three messages (as described in previous post). However, on the 32-bit VM, I only receive one message (as expected).
When I send a message using SendNote on the 32-bit VM, both machines only receive one message.

Both instances of SendNote are identical builds.

Please let me know if you need more information.
Thanks.

#6773
Posted: 06/27/2008 13:45:58
by Tim Sullivan (Standard support level)
Joined: 06/25/2008
Posts: 26

Okay, that makes sense.
Thanks Eugene.
#6774
Posted: 06/27/2008 13:56:42
by Tim Sullivan (Standard support level)
Joined: 06/25/2008
Posts: 26

Sorry for the multiple posts, trying figure this all out.
I changed the mcUDPTransport.MessengerAddress from 0.0.0.0 (default) to 127.0.0.1.
When the destination address is 127.0.0.1, the application receives its own broadcast.
When the destination address is 255.255.255.255, the application does not receive its own broadcast.
More importantly, the application on the 32-bit VM did not receive any of the broadcasts from my local machine (its messengeraddress was changed to 127.0.0.1).

Did I adjust the wrong setting?
Thanks again for the help.
Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.

Reply

Statistics

Topic viewed 9447 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!