lNet Base UDP fail to SendMessage with 22: Invalid Argument on Mac OS X lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- Shebuka · 2012-01-13 17:41 Hi all, the problem is all in subject, after a while debugging my application i'v created a small test project that also doesn't work. Can you see what i'm doing wrong? (basicaly it's console example lupd.pp with gui but wothout server) I don't have a Linux machine to test on till Monday, but i'v tested it on Win and it worked... ---------------------------------------------------------------------- Shebuka · 2012-01-16 15:14 I'v tried the same example code on Linux Ubuntu and it works without errors, so it's definitely a Mac OS X bug. I'v also tried to update to fpc 2.6.0 and Lazarus SVN with no success. ---------------------------------------------------------------------- Shebuka · 2012-01-18 15:22 Found solution: Code: [Select]function TLSocket.DoSend(const aData; const aSize: Integer): Integer; var   AddressLength: Longint = SizeOf(FPeerAddress); begin   if FSocketType = SOCK_STREAM then     Result := Sockets.fpSend(FHandle, @aData, aSize, LMSG)   else     case FAddress.IPv4.sin_family of       LAF_INET  :         begin           AddressLength := SizeOf(FPeerAddress.IPv4);           Result := sockets.fpsendto(FHandle, @aData, aSize, LMSG, @FPeerAddress.IPv4, AddressLength);         end;       LAF_INET6 :         begin           AddressLength := SizeOf(FPeerAddress.IPv6);           Result := sockets.fpsendto(FHandle, @aData, aSize, LMSG, @FPeerAddress.IPv6, AddressLength);         end;     end;     //Result := sockets.fpsendto(FHandle, @aData, aSize, LMSG, @FPeerAddress.IPv4, AddressLength); end; and filled bug report: http://bugs.freepascal.org/view.php?id=21112