almindor/lnet

select ip4 ip6 error?

Closed this issue · 3 comments

./lib/lnet.pp

procedure TLUdp.SetAddress(const Address: string);
var
  n: Integer;
  s: string;
  p: Word;
begin
  if FSocketNet = LAF_INET6 then
    n := Pos(':', Address)  // IPv4
  else
    n := Pos(']:', Address) + 1; // IPv6

May be:

procedure TLUdp.SetAddress(const Address: string);
var
  n: Integer;
  s: string;
  p: Word;
begin
  if FSocketNet = LAF_INET then
    n := Pos(':', Address)  // IPv4
  else
    n := Pos(']:', Address) + 1; // IPv6

if FSocketNet = LAF_INET6

Yes I think you're right, will look into this soon. Thanks!

I post pull request for this bug

Thank you for the PR! this should be fixed now.