Real Software Forums
http://forums.realsoftware.com/

UDP broadcast DataAvailable does not fire
http://forums.realsoftware.com/viewtopic.php?f=2&t=46395
Page 1 of 1

Author:  tjerk [ Mon Dec 31, 2012 5:53 am ]
Post subject:  UDP broadcast DataAvailable does not fire

Using the trial of RealSoftware I am trying to create an application that sends broadcast UDP message to check for available devices on a network.
This works fine as long as devices are in the same range. But somehow the DataAvailable event does not fire for data from other IP ranges.

netIf = System.GetNetworkInterface(cboInterfaces.ListIndex)
UDPSocket1.NetworkInterface = netIf
UDPSocket1.Port = 30718
UDPSocket1.Connect

UDPSocket1.Write(UDPSocket1.BroadcastAddress, DecodeHex("00") + DecodeHex("00") + DecodeHex("00") + DecodeHex("F6"))


DataAvailable event:
data = UDPSocket1.Read()
txtLog.AppendText(data.Address + Chr(13))


Connection directly from my PC to the device:
Sending from 169.254.4.255 to 255.255.255.255
I only receive the echo from 169.254.4.255 in RealSoftware
Wireshark however does show the response from the device: 192.168.5.253 to 169.254.4.255

Tested this with other applications, they do receive the device message in this configuration.


If i put my PC in the network and the device in the same network it works as expected, however I need this application to find unkown devices to be able to give them an IP address.


Please help.. If this works I'll certainly buy the pro version.

Author:  tjerk [ Mon Dec 31, 2012 6:07 am ]
Post subject:  Re: UDP broadcast DataAvailable does not fire

Think I found the issue. When sending data for the first time the Windows Firewall pops up and I grant access. Only it seems that it also needs access to Public networks (although Windows does not show a message for that).

How can I force a request to the Windows firewall to make sure also messages from other IPs will be received?

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/