Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 23 03:11
    rlebeau commented #192
  • Nov 20 21:26
    marcin-bury commented #192
  • Nov 20 19:42
    joostcrommert1 commented #192
  • Nov 20 13:43
    marcin-bury commented #192
  • Nov 18 16:24
    marcin-bury commented #192
  • Nov 18 16:23
    marcin-bury commented #192
  • Nov 18 16:19
    rlebeau commented #192
  • Nov 18 16:17
    rlebeau commented #192
  • Nov 18 13:40
    joostcrommert1 commented #192
  • Nov 18 13:39
    joostcrommert1 commented #192
  • Nov 18 13:39
    joostcrommert1 commented #192
  • Nov 18 13:30
    marcin-bury commented #192
  • Nov 18 12:36
    joostcrommert1 commented #192
  • Nov 18 12:33
    marcin-bury commented #192
  • Nov 16 22:39
    rlebeau edited #71
  • Nov 16 22:31
    rlebeau labeled #439
  • Nov 16 22:31
    rlebeau labeled #439
  • Nov 16 22:31
    rlebeau opened #439
  • Nov 11 00:55

    rlebeau on m1-dns-cache

    Adding DNS cache for Apple M1 s… Fixing DNSCACHE -> USE_DNSCACHE… Changing DNS_CACHE_MINUTES_EXPI… (compare)

  • Nov 08 17:28
    rlebeau closed #438
Remy Lebeau
@rlebeau
@DelphiWorlds well, you didn't say that earlier. That is an OS error, not an Indy error. Where exactly are you seeing that error? What local IP(s) are you binding the client to? You are only setting TIdSocketHandle.Port in code, are you leaving TIdSocketHandle.IP blank? I don't know if you can do that when joining a multicast group as a client
DelphiWorlds
@DelphiWorlds
when setsockopt is called.. that returns -1, and WSGetLastError returns 49
the client binds to a zero address (apparently meaning all)
Remy Lebeau
@rlebeau
@DelphiWorlds when calling setsockopt() with IPV6_ADD_MEMBERSHIP? It binds to interface index 0 (not address 0), which means use the default multicast interface.
DelphiWorlds
@DelphiWorlds
when calling setsockopt() with IPV6_ADD_MEMBERSHIP it passes the group, not an IP address
Remy Lebeau
@rlebeau
@DelphiWorlds IPV6_ADD_MEMBERSHIP specifies the group to join and the network interface to join with
DelphiWorlds
@DelphiWorlds
it's when it calls setsockopt() with IPV6_ADD_MEMBERSHIP that it fails
yes, I have worked that out
the interface index being used is 0, which coincides with other examples I've seen in my searching
Remy Lebeau
@rlebeau
@DelphiWorlds like I said, that just tells the OS to use the default multicast interface, whatever it happens to be, instead of having to specify a specific interface. You could always try stepping into the code with the debugger and play around with the indexes. But I think the first thing you should try is setting the TIdSocketHandle.IP property to the device's local IP when setting up the Bindings collection so TIdIPMCastClient has something specific to bind to locally before joining the group.
DelphiWorlds
@DelphiWorlds
I'm away from my Mac, so I'll check tonight (in about 8 hours from now).. thanks
DelphiWorlds
@DelphiWorlds
I've modified the code to set the only Binding to the first IPv6 address:
procedure TForm1.FormCreate(Sender: TObject);
var
  I: Integer;
  LIP: string;
begin
  FLocalAddresses := TIdStackLocalAddressList.Create;
  GStack.GetLocalAddressList(FLocalAddresses);

  for I := 0 to FLocalAddresses.Count - 1 do
  begin
    if FLocalAddresses[I].IPVersion = TIdIPVersion.Id_IPv6 then
    begin
      LIP := FLocalAddresses[I].IPAddress;
      Break;
    end;
  end;

  if LIP.IsEmpty then
    Exit; // <======

  BroadcastServerIPv6.Port := 6000;
  BroadcastServerIPv6.MulticastGroup := 'FF02:0:0:0:0:0:0:1';
  BroadcastServerIPv6.Active := True;

  BroadcastListenerIPv6.DefaultPort := 6000;
  for I := 0 to BroadcastListenerIPv6.Bindings.Count - 1 do
  begin
    BroadcastListenerIPv6.Bindings.Items[I].Port := BroadcastListenerIPv6.DefaultPort;
    BroadcastListenerIPv6.Bindings.Items[I].IP := LIP;
  end;
  BroadcastListenerIPv6.MulticastGroup := 'FF02:0:0:0:0:0:0:1';
  BroadcastListenerIPv6.Active := True;
end;
when I say "only" I mean that BroadcastListenerIPv6.Bindings.Count = 1
I've been through iterations of this before, one where I've created Bindings for each IPv6 address that the device has.. always results the same: error 49
I'm about to resort to using:
https://github.com/robbiehanson/CocoaAsyncSocket
at least for iOS
DelphiWorlds
@DelphiWorlds
I'd rather not though.. having single source has advantages, however when I've fought with this as much as I have, it might be time to move on
Remy Lebeau
@rlebeau
@DelphiWorlds Are you setting either BroadcastListenerrIPv6.IPVersion := Id_IPv6 or BroadcastListenerIPv6.Bindings.Items[I].IPVersion := Id_IPv6 to match the IP you are assigning? Why do you have a Binding created at design-time if you are just going to overwrite it at runtime? You may as well just use Bindings.Add() at runtime instead.
DelphiWorlds
@DelphiWorlds
Revised code:
const
  cMulticastGroupIPv6 = 'FF02:0:0:0:0:0:0:1';

procedure TForm1.FormCreate(Sender: TObject);
var
  I: Integer;
  LBinding: TIdSocketHandle;
begin
  FLocalAddresses := TIdStackLocalAddressList.Create;
  GStack.GetLocalAddressList(FLocalAddresses);

  BroadcastServerIPv6.Port := 6000;
  BroadcastServerIPv6.MulticastGroup := cMulticastGroupIPv6;
  BroadcastServerIPv6.Active := True;

  BroadcastListenerIPv6.DefaultPort := 6000;
  BroadcastListenerIPv6.IPVersion := TIdIPVersion.Id_IPv6;
  BroadcastListenerIPv6.MulticastGroup := cMulticastGroupIPv6;
  BroadcastListenerIPv6.Bindings.Clear;
  for I := 0 to FLocalAddresses.Count - 1 do
  begin
    if FLocalAddresses[I].IPVersion = TIdIPVersion.Id_IPv6 then
    begin
      LBinding := BroadcastListenerIPv6.Bindings.Add;
      LBinding.IP := FLocalAddresses[I].IPAddress;
      LBinding.IPVersion := TIdIPVersion.Id_IPv6;
      LBinding.Port := BroadcastListenerIPv6.DefaultPort;
    end;
  end;
  BroadcastListenerIPv6.Active := True;
end;
Just so that it's clear what is and is not being set
Remy Lebeau
@rlebeau
@DelphiWorlds and? what happens with it? If it is still not working, I don't know what else to tell you. I've only worked with multicast once before, but it was on Windows using IPv4, and I didn't use Indy for it, I used straight Winsock calls. But TIdIPMCastClient basically makes the same Winsock calls I did. The only difference being that I also enabled the SO_REUSEADDR option (the ReuseSocket property in Indy), but I don't think that is a factor in your situation. Try talking to Apple about your error.
DelphiWorlds
@DelphiWorlds
same error, i.e. error 49.
DelphiWorlds
@DelphiWorlds
I may have solved the binding issue, however unless another issue I'm having is resolved, it'll be rather moot. I've posted to the delphi.internet.winsock group in the forums and posted an attachment to the attachments group which illustrates the issue, which is happening on Windows, before I've even tried any other platforms
mezen
@mezen
Is there a Delphi equivalent to this powershell code?
$fqdn = [System.Net.Dns]::GetHostEntry("host-name-goes-here").HostName
Kudzu
@czhower
The Indy DNS compononent can do that.
mezen
@mezen
TIdDNSResolver needs a DNS Server in Host, the powershell code does not. I have 2 network cards here with each card has multiple dns server set. What to do?
Kudzu
@czhower
You can read the system dns from the registry or use any DNS server as they area all public. Google DNS is 8.8.8.8 and 8.8.4.4
mezen
@mezen
Google DNS does not help with LAN Requests :(
Kudzu
@czhower
Then you need to use the winapi or registry to find your local dns server.
Remy Lebeau
@rlebeau
@DelphiWorlds I glanced at the example you posted, offhand I don't know why it is not working, but I have not had a chance to run it yet. I've been out of town the past week and just saw the post this morning
@mezen the simplest equivilent is to 1) resolve the IP using the socket API gethostname() or getaddrinfo() directly (which are wrapped by Indy's TIdStack.HostByName() method), which uses the OS's own DNS resolver; and then 2) resolve the HostName using gethostbyaddr() or getnameinfo() (which are wrapped by Indy's TIdStack.HostByAddress() method), which also use the OS's own DNS resolver. Yes, TIdDNSResolverrequires a Host, because it implements DNS manually from scratch, and doesn't use the OS resolver at all. You can query your OS's DNS server(s), or let the user specify them.
DelphiWorlds
@DelphiWorlds
ok.. thanks
MravArun
@MravArun
Hello Techies, I am new to this forum I have a problem with INDY IDHTTP and IDSSLIOHANDLERSOCKET in delphi 5, after adding 3DES encyption in the server, all the rest call using "THTTP" fails with exception "Error Connecting with SSL", is there a way to fix this ? thanks in advance...!!
Remy Lebeau
@rlebeau
@MravArun are you using an up-to-date version of Indy 10? Are you using OpenSSL DLLs that have 3DES enabled? You might have to tweak the IOHandler's CipherList property to control which ciphers are enabled.
@MravArun also note that 3DES is vulnerable to attack, so why would you want to enable it in your server in the first place?
penengo
@penengo
Hello, How can I synchronize TcpServerExecute with external global variables, with Delphi Anonymous method is suggested, but We are using c++ builder 10.2 already we use TidSync but is deprecated. Thank in advance for some help
Remy Lebeau
@rlebeau
@penengo TIdSync still works, but is deprecated because TThread::Synchronize() with an anonymous procedure accomplishes the same thing that TIdSync was originally intended for. Read Embarcadero's documentation for How to Handle Delphi Anonymous Methods in C++.
penengo
@penengo
Thank you @rlebeau
irawancepu
@irawancepu
I want to replicate this site : https://hide.me/id/proxy to work in my internal network. From where i must begin?
DelphiWorlds
@DelphiWorlds
@rlebeau Is support for OpenSSL 1.1.0 coming? I managed to successfully build iOS simulator dylibs for 1.1.0f, and tweaked IdSSLOpenSSLHeaders so it would load the new version, however it failed to bind to a number of routines, namely: SSL_load_error_strings, SSL_library_init, SSLeay_version etc
at least I assume it failed to bind to them because that's what WhichFailedToLoad reports
DelphiWorlds
@DelphiWorlds
Complete list: SSL_load_error_strings,SSL_library_init,SSLeay_version,SSLeay,CRYPTO_lock,CRYPTO_num_locks,CRYPTO_set_locking_callback,CRYPTO_set_id_callback,ERR_free_strings,EVP_MD_CTX_init,EVP_CIPHER_CTX_flags,HMAC_CTX_init,HMAC_CTX_cleanup,CRYPTO_mem_leaks,CRYPTO_set_mem_debug_functions,OpenSSL_add_all_algorithms,OpenSSL_add_all_ciphers,OpenSSL_add_all_digests,EVP_cleanup,sk_num,sk_new,sk_new_null,sk_free,sk_push,sk_dup,sk_find,sk_value
Remy Lebeau
@rlebeau
@DelphiWorlds no work has been started yet to support 1.1.0: IndySockets/Indy#183
DelphiWorlds
@DelphiWorlds
Thanks for the update
robert010
@robert010
Looking for help on udp performance with delphi and Rad studio with wireless link
Remy Lebeau
@rlebeau
@robert010 what kind of help?
robert010
@robert010
Performance. I am using Udp so I can broadcast to multiple devices. I have fairly small messages, 96 bytes every 77 ms.. everything works fine over wired lan, but it doesn't work reliably over wireless
I found the best performance by setting the client (sender) buffer to 0, and flat out sending the output message twice.
Wondering what I can tweak and what status I can look at to see what's happening.