Merijn Bosma wrote:
> Hi all,
> 
> I've been using ICS for a long time, in different environments and on
> different machines without problems.
> Now I've stumbled upon a problem of which at the moment I don't know
> how to find a solution for. It's regarding a snippet which sens data
> using UDP. The relevant code boils down to:
> 
> 
>   with TWSocket.Create(nil) do
>   begin
>    Proto := 'udp';
>    Port := some port;
>    Addr := some ip;
>    Connect();
>    SendStr('some data');
>    Close();
>    Free();
>   end;
> 
> Very simple, and works great.
> 
> Now on two machines we have an issue while using this code. The call
> to Close() will block for 4 to 6 seconds if:
> - I'm sending to an IP address within my own subnet
> - There is no actual PC at that IP (doesn't have to be running a UDP
> server, just a PC with that ip address).

That sounds very similar to an issue Francois reported several months
back and which turned out to be a winsock bug IMO.
In Vista+ winsock repeated the ARP request within a few seconds 2 times
to get the MAC address that accepts packets for the destination if the 
request failed because the destination did not exist.
In Win XP there's only one ARP request sent.

The call to WSocket_Synchronized_closesocket(FHSocket) which calls
the native winsock API function doesn't return while winsock is still
trying to get the MAC address of a non-existing host.

-- 
Arno Garrels
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to