> What type of error conditions/exceptions might occur
> in the sending code that I need to watch for?

The paramaters you give may be unable to resolve from name to numbers.

> Can I cache the domain lookup

First do a DnsLookup for 'mydomain.com' and then use the IP address. Will be
much faster afterward.

> if sending a few packets in a short span?

No problem except UDP is an unreliable protocol by design. So if you send
too much packets in a short time interval, some may be lost, specially if
there are speed differences in network speed between the sender and the
receiver. A slow speed segment may cause packet drop. Network congestion can
also result in packet drop. Multiple routes may cause packet order errors or
duplicate packets. All this is not a matter of component but only the way
UDP protocol has been designed. You application must be prepared to all
those kind f errors. Or use TCP which doesn't suffer from any.

Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
http://www.overbyte.be

----- Original Message ----- 
From: "Johnnie Norsworthy" <[EMAIL PROTECTED]>
To: <twsocket@elists.org>
Sent: Tuesday, August 01, 2006 9:26 PM
Subject: [twsocket] Converting from Indy - UDP Send - DNS caching


> I am converting a small remote logging project from Indy to ICS that
> sends UDP packets. Following the example in UDPSend1.pas, I do the
> following when I wish to send my string:
>
>   WSocket.Proto := 'udp';
>   WSocket.Addr  := 'mydomain.com';
>   WSocket.Port  := '12007';
>   WSocket.Connect;
>   WSocket.SendStr('mystring');
>
> in the WSocket.DataSent() event:
>   WSocket.Close;
>
> What type of error conditions/exceptions might occur in the sending
> code that I need to watch for? Is there ever a situation when .Connect
> would fail due to an existing connection if sending a few packets in a
> short span?
>
> Do I need to add #13 #10 to strings before sending?
>
> Can I cache the domain lookup after sending the first packet to speed
> up the send process or is it helpful? If so, in what event do I grab
> the looked up IP Address and from what property?
>
> Thanks! I am looking forward to using ICS.
>
> -Johnnie
> -- 
> To unsubscribe or change your settings for TWSocket mailing list
> please goto http://www.elists.org/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be

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

Reply via email to