Why not open the socket at the start, then just call WSocket.SendStr when you want to send something. Yes, you need to add #13#10 if your receiver needs it, calling SendStr does not add this for you.
Dan -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Johnnie Norsworthy Sent: 01 August 2006 20:26 To: firstname.lastname@example.org 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