Re: [twsocket] UDP question...
This is the first time I am writing a UDP server. The other UDP was a client. It was fairly straight forward. As the server lets say I have 2 clients, A and B, that will be sending me unsolicited data of 100 bytes per message. If I understand, when TWSocket.OnDataAvailable fires the data source can be mixed. For example I could get 10 bytes from A, then 19 bytes from B, then 14 bytes from B and then 56 bytes from A, etc. And I might not get the hundred bytes. I might only get 45. No, this is wrong. UDP is a datagram protocol. Datagram boundaries are respected. If you send 100 bytes (in one call to Send of course), you'll receive exactly 100 bytes in one call to Receive done from one OnDataAvailable event. There are a few things you must pay attention: TWSocket.BufSize must be large enough for your larger datagram (It default to 1460 bytes); when calling Receive or ReceiveFrom (to know who sent the packet), you must pass a bufer larger enough; not all physical networks are able to send any arbitrary large datagram. There is a limit imposed by each network. This is totally diffrent for TCP which is a stream protocol. For a complete description, see TCP/UDP primer document available from my website. -- [EMAIL PROTECTED] The author of the freeware multi-tier middleware MidWare The author of the freeware Internet Component Suite (ICS) http://www.overbyte.be -- 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
Re: [twsocket] UDP question...
I think with UDP you get can get packets in different order, not get them at all, get them repeated.. but as opposed to TCP you get entire packets, if you send 100 bytes at once, you get 100 at once. Someone correct me if I'm wrong.. You are right. -- [EMAIL PROTECTED] The author of the freeware multi-tier middleware MidWare The author of the freeware Internet Component Suite (ICS) http://www.overbyte.be -- 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
Re: [twsocket] UDP question...
Thanks for the answer and the link. This has now become a bit easier task. One last question. The PC has several network cards and the networks are completely separate. I need to handle datagrams from all networks. I have a TWSocket with addr set to 0.0.0.0 and localAddr is blank. I assume this will allow me to listen on all networks. I get the source address using ReceiveFrom and use SendTo to send the response. That all sound good? Thanks, Mark -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Francois PIETTE Sent: Tuesday, July 22, 2008 3:13 AM To: ICS support mailing Subject: Re: [twsocket] UDP question... This is the first time I am writing a UDP server. The other UDP was a client. It was fairly straight forward. As the server lets say I have 2 clients, A and B, that will be sending me unsolicited data of 100 bytes per message. If I understand, when TWSocket.OnDataAvailable fires the data source can be mixed. For example I could get 10 bytes from A, then 19 bytes from B, then 14 bytes from B and then 56 bytes from A, etc. And I might not get the hundred bytes. I might only get 45. No, this is wrong. UDP is a datagram protocol. Datagram boundaries are respected. If you send 100 bytes (in one call to Send of course), you'll receive exactly 100 bytes in one call to Receive done from one OnDataAvailable event. There are a few things you must pay attention: TWSocket.BufSize must be large enough for your larger datagram (It default to 1460 bytes); when calling Receive or ReceiveFrom (to know who sent the packet), you must pass a bufer larger enough; not all physical networks are able to send any arbitrary large datagram. There is a limit imposed by each network. This is totally diffrent for TCP which is a stream protocol. For a complete description, see TCP/UDP primer document available from my website. -- [EMAIL PROTECTED] The author of the freeware multi-tier middleware MidWare The author of the freeware Internet Component Suite (ICS) http://www.overbyte.be -- 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 -- 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
Re: [twsocket] UDP question...
Thanks for the answer and the link. This has now become a bit easier task. One last question. The PC has several network cards and the networks are completely separate. I need to handle datagrams from all networks. I have a TWSocket with addr set to 0.0.0.0 and localAddr is blank. I assume this will allow me to listen on all networks. I get the source address using ReceiveFrom and use SendTo to send the response. That all sound good? Yes, very good. Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] The author of the freeware multi-tier middleware MidWare The author of the freeware Internet Component Suite (ICS) http://www.overbyte.be -- 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
Re: [twsocket] Send an html mail
That is it! Thanks a lot! - Original Message - From: Arno Garrels [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Monday, July 21, 2008 4:18 PM Subject: Re: [twsocket] Send an html mail Arno Garrels wrote: Probably the body of the HTML page just uses a different charset. If so, try to change property Charset of the component to the charset of the HTML body. If that doesn't help upload the page somewhere and post the link here. I just found that the THtmlSmtpCli doesn't have a published property HtmlCharset, sorry. But it is very easy to fix, just add two lines like shown below, save and rebuild the ICS package. In (OverbyteIcs)SmtpProt.pas search the string property HtmlText : TStrings read FHtmlText [..] published property EmailImages : TStrings read FEmailImages write SetEmailImages; property PlainText : TStrings read FPlainText write SetPlainText; property HtmlText : TStrings read FHtmlText write SetHtmlText; add= property HtmlCharset : String read FHtmlCharset add= write FHtmlCharset; end; [..] I'm pretty sure that we will see this change in the next release. -- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html -- 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