Jump to content
GreatDayDan

"Network Unreachable" when tethering.

Recommended Posts

"Network Unreachable" when tethering.
I am running the BDShoppingList project in "C:\Users\Public\Documents\Embarcadero\Studio\19.0\Samples\Object Pascal\RTL\Tethering\BDShoppingList"
It runs well in Windows but when I run the Android target I get this exception.

The exception is raised in this proc:

procedure TTetheringNetworkServerCommUDP.BroadcastData(const AData: TBytes; const AHost: string; InitialPort, FinalPort: Integer);
var
I: Integer;
LHost: string;
begin
if TTetheringAdapter.IsLoggingItem(TTetheringAdapter.TTetheringLogItem.Comm) then
TLogAdapter.Log('** UDP ** BroadcastData to "' + AHost + '": "' + TEncoding.UTF8.GetString(AData) + '"');
if AHost = '' then
begin
if FIPVersion = TCommIPVersion.IP_IPv4 then
LHost := '255.255.255.255'
else
LHost := '0:0:0:0:0:0:255.255.255.255';

for I := InitialPort to FinalPort do
FUDPServer.Broadcast(AData, I, LHost)
end
else
for I := InitialPort to FinalPort do
FUDPServer.SendBuffer(AHost, I, AData);
end;


My understanding is that to look for tethered apps on my subnets I need to use DiscoverManagers(2000, '192.168.1.0') {timeout, use all my subnets}

The LHost is being assigned (255.255.255.255). Shouldn't that be (255.255.255.0)?

 

Using CE 10.2

Share this post


Link to post

Click on the </> button in the editor, paste your code in the new window and choose the appropriate language for high lightning.

 

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×