Re: [twsocket] Delphi TServerSocket vs ICS equivalent
Thanks for that. Makes very useful reading. Graham -Original Message- From: TWSocket [mailto:twsocket-boun...@lists.elists.org] On Behalf Of Robert Van Gemert Sent: 16 October 2013 10:42 To: 'ICS support mailing' Subject: Re: [twsocket] Delphi TServerSocket vs ICS equivalent You can get a sample from http://members.optusnet.com.au/rcvangemert/ -Original Message- From: TWSocket [mailto:twsocket-boun...@lists.elists.org] On Behalf Of Graham Powell Sent: Wednesday, 16 October 2013 8:34 PM To: 'ICS support mailing' Subject: Re: [twsocket] Delphi TServerSocket vs ICS equivalent Yes. At the moment it's working fine with the Delphi TServerSocket component. I recently found a bug which may have been the root cause of my problems. However sample code of the ICS implementation would be useful for the future as I'm sure Delphi will try and force us to go the Indy route. Regards Graham -Original Message- From: TWSocket [mailto:twsocket-boun...@lists.elists.org] On Behalf Of Robert Van Gemert Sent: 16 October 2013 10:26 To: 'ICS support mailing' Subject: Re: [twsocket] Delphi TServerSocket vs ICS equivalent Is this is the mos protocol uses with news room computer systems? I have an implementation using TWSocketServer and TWSocket and may be able to help. Robert -Original Message- From: TWSocket [mailto:twsocket-boun...@lists.elists.org] On Behalf Of Graham Powell Sent: Wednesday, 16 October 2013 2:15 AM To: 'ICS support mailing' Subject: Re: [twsocket] Delphi TServerSocket vs ICS equivalent The 20 seconds is plenty long enough as a timeout and it is configurable by the user if necessary. One minor addition to your scheme if I decide to use your component is that all the data is Unicode (high byte first) to the end tag is actually: null < null / null m null o null s null > Graham -Original Message- From: TWSocket [mailto:twsocket-boun...@lists.elists.org] On Behalf Of François Piette Sent: 12 October 2013 09:26 To: 'ICS support mailing' Subject: Re: [twsocket] Delphi TServerSocket vs ICS equivalent > This is how it works at the moment. > I have an array of records. Each record contains a string and an integer. > The string is used to hold the incoming data and integer hold the > timeout value that counts down. > As data arrives it is added to the string associated with the correct client and the timeout is reset to 20 seconds. > Periodically I check each of the strings in the array to see if > and exist. > If this is the case the message is extracted from the string and processed. > The timeout is now turned off. IMO this is bad design because you have no control on the network speed. Whatever you select as timeout it is always possible to have an issue with network speed and congestion. Long timeout will makes the code works most of the time. > Occasionally I get issues with data appearing to be corrupt. Investigations are continuing, but the > origin of this e-mail trail was to establish if it worth my while > changing from Delphi TServerSocket > to the ICS server component. Is the ICS component known to be better > in whatever respect or is > it just an equally good alternative. ICS component may be the best component, but bad design won't definitely not solve all issues. You should REALLY change your design. Please re-read my previous emails. Summary: Use "" as LineEnd in TWSocket and let the component assemble the message for you and trigger the OnDataAvailable only when you have received the end marker. Use a TTimer to process timeout: if you don't get a complete message (So no OnDataAvailable), before - let's say - one minute, then call Abort to close the connection and report an error. Alternatively, you may parse the XML as data is coming thru and detect when the ending tag has been reached. This is more complex as you need an XML parser able to parse a stream as it comes, but this will permit having a message embedded into another one. -- francois.pie...@overbyte.be Embarcadero MVP http://www.overbyte.be http://francois-piette.blogspot.com -- 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 -- 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 -- To unsubscribe or change your settings for
Re: [twsocket] Delphi TServerSocket vs ICS equivalent
You can get a sample from http://members.optusnet.com.au/rcvangemert/ -Original Message- From: TWSocket [mailto:twsocket-boun...@lists.elists.org] On Behalf Of Graham Powell Sent: Wednesday, 16 October 2013 8:34 PM To: 'ICS support mailing' Subject: Re: [twsocket] Delphi TServerSocket vs ICS equivalent Yes. At the moment it's working fine with the Delphi TServerSocket component. I recently found a bug which may have been the root cause of my problems. However sample code of the ICS implementation would be useful for the future as I'm sure Delphi will try and force us to go the Indy route. Regards Graham -Original Message- From: TWSocket [mailto:twsocket-boun...@lists.elists.org] On Behalf Of Robert Van Gemert Sent: 16 October 2013 10:26 To: 'ICS support mailing' Subject: Re: [twsocket] Delphi TServerSocket vs ICS equivalent Is this is the mos protocol uses with news room computer systems? I have an implementation using TWSocketServer and TWSocket and may be able to help. Robert -Original Message- From: TWSocket [mailto:twsocket-boun...@lists.elists.org] On Behalf Of Graham Powell Sent: Wednesday, 16 October 2013 2:15 AM To: 'ICS support mailing' Subject: Re: [twsocket] Delphi TServerSocket vs ICS equivalent The 20 seconds is plenty long enough as a timeout and it is configurable by the user if necessary. One minor addition to your scheme if I decide to use your component is that all the data is Unicode (high byte first) to the end tag is actually: null < null / null m null o null s null > Graham -Original Message- From: TWSocket [mailto:twsocket-boun...@lists.elists.org] On Behalf Of François Piette Sent: 12 October 2013 09:26 To: 'ICS support mailing' Subject: Re: [twsocket] Delphi TServerSocket vs ICS equivalent > This is how it works at the moment. > I have an array of records. Each record contains a string and an integer. > The string is used to hold the incoming data and integer hold the > timeout value that counts down. > As data arrives it is added to the string associated with the correct client and the timeout is reset to 20 seconds. > Periodically I check each of the strings in the array to see if > and exist. > If this is the case the message is extracted from the string and processed. > The timeout is now turned off. IMO this is bad design because you have no control on the network speed. Whatever you select as timeout it is always possible to have an issue with network speed and congestion. Long timeout will makes the code works most of the time. > Occasionally I get issues with data appearing to be corrupt. Investigations are continuing, but the > origin of this e-mail trail was to establish if it worth my while > changing from Delphi TServerSocket > to the ICS server component. Is the ICS component known to be better > in whatever respect or is > it just an equally good alternative. ICS component may be the best component, but bad design won't definitely not solve all issues. You should REALLY change your design. Please re-read my previous emails. Summary: Use "" as LineEnd in TWSocket and let the component assemble the message for you and trigger the OnDataAvailable only when you have received the end marker. Use a TTimer to process timeout: if you don't get a complete message (So no OnDataAvailable), before - let's say - one minute, then call Abort to close the connection and report an error. Alternatively, you may parse the XML as data is coming thru and detect when the ending tag has been reached. This is more complex as you need an XML parser able to parse a stream as it comes, but this will permit having a message embedded into another one. -- francois.pie...@overbyte.be Embarcadero MVP http://www.overbyte.be http://francois-piette.blogspot.com -- 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 -- 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 -- 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] Delphi TServerSocket vs ICS equivalent
Yes. At the moment it's working fine with the Delphi TServerSocket component. I recently found a bug which may have been the root cause of my problems. However sample code of the ICS implementation would be useful for the future as I'm sure Delphi will try and force us to go the Indy route. Regards Graham -Original Message- From: TWSocket [mailto:twsocket-boun...@lists.elists.org] On Behalf Of Robert Van Gemert Sent: 16 October 2013 10:26 To: 'ICS support mailing' Subject: Re: [twsocket] Delphi TServerSocket vs ICS equivalent Is this is the mos protocol uses with news room computer systems? I have an implementation using TWSocketServer and TWSocket and may be able to help. Robert -Original Message- From: TWSocket [mailto:twsocket-boun...@lists.elists.org] On Behalf Of Graham Powell Sent: Wednesday, 16 October 2013 2:15 AM To: 'ICS support mailing' Subject: Re: [twsocket] Delphi TServerSocket vs ICS equivalent The 20 seconds is plenty long enough as a timeout and it is configurable by the user if necessary. One minor addition to your scheme if I decide to use your component is that all the data is Unicode (high byte first) to the end tag is actually: null < null / null m null o null s null > Graham -Original Message- From: TWSocket [mailto:twsocket-boun...@lists.elists.org] On Behalf Of François Piette Sent: 12 October 2013 09:26 To: 'ICS support mailing' Subject: Re: [twsocket] Delphi TServerSocket vs ICS equivalent > This is how it works at the moment. > I have an array of records. Each record contains a string and an integer. > The string is used to hold the incoming data and integer hold the > timeout value that counts down. > As data arrives it is added to the string associated with the correct client and the timeout is reset to 20 seconds. > Periodically I check each of the strings in the array to see if > and exist. > If this is the case the message is extracted from the string and processed. > The timeout is now turned off. IMO this is bad design because you have no control on the network speed. Whatever you select as timeout it is always possible to have an issue with network speed and congestion. Long timeout will makes the code works most of the time. > Occasionally I get issues with data appearing to be corrupt. Investigations are continuing, but the > origin of this e-mail trail was to establish if it worth my while > changing from Delphi TServerSocket > to the ICS server component. Is the ICS component known to be better > in whatever respect or is > it just an equally good alternative. ICS component may be the best component, but bad design won't definitely not solve all issues. You should REALLY change your design. Please re-read my previous emails. Summary: Use "" as LineEnd in TWSocket and let the component assemble the message for you and trigger the OnDataAvailable only when you have received the end marker. Use a TTimer to process timeout: if you don't get a complete message (So no OnDataAvailable), before - let's say - one minute, then call Abort to close the connection and report an error. Alternatively, you may parse the XML as data is coming thru and detect when the ending tag has been reached. This is more complex as you need an XML parser able to parse a stream as it comes, but this will permit having a message embedded into another one. -- francois.pie...@overbyte.be Embarcadero MVP http://www.overbyte.be http://francois-piette.blogspot.com -- 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 -- 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] Delphi TServerSocket vs ICS equivalent
Is this is the mos protocol uses with news room computer systems? I have an implementation using TWSocketServer and TWSocket and may be able to help. Robert -Original Message- From: TWSocket [mailto:twsocket-boun...@lists.elists.org] On Behalf Of Graham Powell Sent: Wednesday, 16 October 2013 2:15 AM To: 'ICS support mailing' Subject: Re: [twsocket] Delphi TServerSocket vs ICS equivalent The 20 seconds is plenty long enough as a timeout and it is configurable by the user if necessary. One minor addition to your scheme if I decide to use your component is that all the data is Unicode (high byte first) to the end tag is actually: null < null / null m null o null s null > Graham -Original Message- From: TWSocket [mailto:twsocket-boun...@lists.elists.org] On Behalf Of François Piette Sent: 12 October 2013 09:26 To: 'ICS support mailing' Subject: Re: [twsocket] Delphi TServerSocket vs ICS equivalent > This is how it works at the moment. > I have an array of records. Each record contains a string and an integer. > The string is used to hold the incoming data and integer hold the > timeout value that counts down. > As data arrives it is added to the string associated with the correct client and the timeout is reset to 20 seconds. > Periodically I check each of the strings in the array to see if > and exist. > If this is the case the message is extracted from the string and processed. > The timeout is now turned off. IMO this is bad design because you have no control on the network speed. Whatever you select as timeout it is always possible to have an issue with network speed and congestion. Long timeout will makes the code works most of the time. > Occasionally I get issues with data appearing to be corrupt. Investigations are continuing, but the > origin of this e-mail trail was to establish if it worth my while > changing from Delphi TServerSocket > to the ICS server component. Is the ICS component known to be better > in whatever respect or is > it just an equally good alternative. ICS component may be the best component, but bad design won't definitely not solve all issues. You should REALLY change your design. Please re-read my previous emails. Summary: Use "" as LineEnd in TWSocket and let the component assemble the message for you and trigger the OnDataAvailable only when you have received the end marker. Use a TTimer to process timeout: if you don't get a complete message (So no OnDataAvailable), before - let's say - one minute, then call Abort to close the connection and report an error. Alternatively, you may parse the XML as data is coming thru and detect when the ending tag has been reached. This is more complex as you need an XML parser able to parse a stream as it comes, but this will permit having a message embedded into another one. -- francois.pie...@overbyte.be Embarcadero MVP http://www.overbyte.be http://francois-piette.blogspot.com -- 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 -- 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] Delphi TServerSocket vs ICS equivalent
The 20 seconds is plenty long enough as a timeout and it is configurable by the user if necessary. One minor addition to your scheme if I decide to use your component is that all the data is Unicode (high byte first) to the end tag is actually: null < null / null m null o null s null > Graham -Original Message- From: TWSocket [mailto:twsocket-boun...@lists.elists.org] On Behalf Of François Piette Sent: 12 October 2013 09:26 To: 'ICS support mailing' Subject: Re: [twsocket] Delphi TServerSocket vs ICS equivalent > This is how it works at the moment. > I have an array of records. Each record contains a string and an integer. > The string is used to hold the incoming data and integer hold the > timeout value that counts down. > As data arrives it is added to the string associated with the correct client and the timeout is reset to 20 seconds. > Periodically I check each of the strings in the array to see if > and exist. > If this is the case the message is extracted from the string and processed. > The timeout is now turned off. IMO this is bad design because you have no control on the network speed. Whatever you select as timeout it is always possible to have an issue with network speed and congestion. Long timeout will makes the code works most of the time. > Occasionally I get issues with data appearing to be corrupt. Investigations are continuing, but the > origin of this e-mail trail was to establish if it worth my while > changing from Delphi TServerSocket > to the ICS server component. Is the ICS component known to be better > in whatever respect or is > it just an equally good alternative. ICS component may be the best component, but bad design won't definitely not solve all issues. You should REALLY change your design. Please re-read my previous emails. Summary: Use "" as LineEnd in TWSocket and let the component assemble the message for you and trigger the OnDataAvailable only when you have received the end marker. Use a TTimer to process timeout: if you don't get a complete message (So no OnDataAvailable), before - let's say - one minute, then call Abort to close the connection and report an error. Alternatively, you may parse the XML as data is coming thru and detect when the ending tag has been reached. This is more complex as you need an XML parser able to parse a stream as it comes, but this will permit having a message embedded into another one. -- francois.pie...@overbyte.be Embarcadero MVP http://www.overbyte.be http://francois-piette.blogspot.com -- 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] Delphi TServerSocket vs ICS equivalent
> This is how it works at the moment. > I have an array of records. Each record contains a string and an integer. > The string is used to hold the incoming data and integer hold the timeout value that counts down. > As data arrives it is added to the string associated with the correct client and the timeout is reset to 20 seconds. > Periodically I check each of the strings in the array to see if and exist. > If this is the case the message is extracted from the string and processed. > The timeout is now turned off. IMO this is bad design because you have no control on the network speed. Whatever you select as timeout it is always possible to have an issue with network speed and congestion. Long timeout will makes the code works most of the time. > Occasionally I get issues with data appearing to be corrupt. Investigations are continuing, but the > origin of this e-mail trail was to establish if it worth my while changing from Delphi TServerSocket > to the ICS server component. Is the ICS component known to be better in whatever respect or is > it just an equally good alternative. ICS component may be the best component, but bad design won't definitely not solve all issues. You should REALLY change your design. Please re-read my previous emails. Summary: Use "" as LineEnd in TWSocket and let the component assemble the message for you and trigger the OnDataAvailable only when you have received the end marker. Use a TTimer to process timeout: if you don't get a complete message (So no OnDataAvailable), before - let's say - one minute, then call Abort to close the connection and report an error. Alternatively, you may parse the XML as data is coming thru and detect when the ending tag has been reached. This is more complex as you need an XML parser able to parse a stream as it comes, but this will permit having a message embedded into another one. -- francois.pie...@overbyte.be Embarcadero MVP http://www.overbyte.be http://francois-piette.blogspot.com -- 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] Delphi TServerSocket vs ICS equivalent
Yes, I guess that's possible. This is how it works at the moment. I have an array of records. Each record contains a string and an integer. The string is used to hold the incoming data and integer hold the timeout value that counts down. As data arrives it is added to the string associated with the correct client and the timeout is reset to 20 seconds. Periodically I check each of the strings in the array to see if and exist. If this is the case the message is extracted from the string and processed. The timeout is now turned off. Occasionally I get issues with data appearing to be corrupt. Investigations are continuing, but the origin of this e-mail trail was to establish if it worth my while changing from Delphi TServerSocket to the ICS server component. Is the ICS component known to be better in whatever respect or is it just an equally good alternative. Graham -Original Message- From: TWSocket [mailto:twsocket-boun...@lists.elists.org] On Behalf Of François Piette Sent: 09 October 2013 17:21 To: 'ICS support mailing' Subject: Re: [twsocket] Delphi TServerSocket vs ICS equivalent > The data is enclosed with a standard tag format. In this case it is ., so I know when > I have received a complete message So you have a delimiter which is "". It could be sed for TWSocket LineMode. Note that you cannot have embedded messages in messages. -- francois.pie...@overbyte.be Embarcadero MVP http://www.overbyte.be http://francois-piette.blogspot.com -- 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] Delphi TServerSocket vs ICS equivalent
> The data is enclosed with a standard tag format. In this case it is ., so I know when > I have received a complete message So you have a delimiter which is "". It could be sed for TWSocket LineMode. Note that you cannot have embedded messages in messages. -- francois.pie...@overbyte.be Embarcadero MVP http://www.overbyte.be http://francois-piette.blogspot.com -- 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] Delphi TServerSocket vs ICS equivalent
> Alternatively you start a timer with short interval (100 ms) when you receive data, > reset the timer each time you receive data and keep adding the data to a buffer. > Once the timer triggers you can assume you have all data. > This way it keeps working of the XML layout changes :) I don't agree with you. A timer is really not suitable for the purpose, unless you use a looong time. This is because you have no control about the speed of the network. Using a timer like that is the best way to have very difficult to catch issues occurring when network is heavily loaded or slow. -- francois.pie...@overbyte.be Embarcadero MVP http://www.overbyte.be http://francois-piette.blogspot.com -- 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] Delphi TServerSocket vs ICS equivalent
> Alternatively you start a timer with short interval (100 ms) when > you receive data, reset the timer each time you receive data and > keep adding the data to a buffer. > Once the timer triggers you can assume you have all data. This way > it keeps working of the XML layout changes :) A timer is fine to handle lost connections where a partial record may have been received without an expected record end, but is quite an overhead (particularly with multiple clients) where there are better record ends: XML end tag, maximum expected record length, CRLF, blank line, etc. I variously use them all to avoid buffering too much data. Angus -- 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] Delphi TServerSocket vs ICS equivalent
Alternatively you start a timer with short interval (100 ms) when you receive data, reset the timer each time you receive data and keep adding the data to a buffer. Once the timer triggers you can assume you have all data. This way it keeps working of the XML layout changes :) Merijn On 9-10-2013 09:26, Graham Powell wrote: The data is enclosed with a standard tag format. In this case it is ., so I know when I have received a complete message The message may or may not include carriage returns or line feeds. These would be removed anyway as they have no meaning within the message. Graham -Original Message- From: TWSocket [mailto:twsocket-boun...@lists.elists.org] On Behalf Of François Piette Sent: 08 October 2013 19:57 To: 'ICS support mailing' Subject: Re: [twsocket] Delphi TServerSocket vs ICS equivalent How the messages are sent to me is out of my control. But the client will not send me another message until the previous one has been acknowledged. If I don't respond at all the client will timeout, close the socket connection, re-open it and send the original message again. If your XML message has no delimiter, then you must parse it on the fly - which is possible - so that you know when it is complete and time to process it. This is a perfectly usable strategy but this is not what is usually done. Usually, either there is a delimiter at the end of the data, or there is a length expressed in front of data. The receiver then knows when everything has been received without any knowledge - beside length or delimiter - of the "message" content. This helps building a layered application where transport and processing is clearly distinguished. Of course those considerations are not dependent on the component used. What you use with the old component is for sure good for ICS component as well. -- francois.pie...@overbyte.be Embarcadero MVP http://www.overbyte.be http://francois-piette.blogspot.com -- 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] Delphi TServerSocket vs ICS equivalent
The data is enclosed with a standard tag format. In this case it is ., so I know when I have received a complete message The message may or may not include carriage returns or line feeds. These would be removed anyway as they have no meaning within the message. Graham -Original Message- From: TWSocket [mailto:twsocket-boun...@lists.elists.org] On Behalf Of François Piette Sent: 08 October 2013 19:57 To: 'ICS support mailing' Subject: Re: [twsocket] Delphi TServerSocket vs ICS equivalent > How the messages are sent to me is out of my control. But the client > will not send me another > message until the previous one has been acknowledged. If I don't > respond at all the client will > timeout, close the socket connection, re-open it and send the original message again. If your XML message has no delimiter, then you must parse it on the fly - which is possible - so that you know when it is complete and time to process it. This is a perfectly usable strategy but this is not what is usually done. Usually, either there is a delimiter at the end of the data, or there is a length expressed in front of data. The receiver then knows when everything has been received without any knowledge - beside length or delimiter - of the "message" content. This helps building a layered application where transport and processing is clearly distinguished. Of course those considerations are not dependent on the component used. What you use with the old component is for sure good for ICS component as well. -- francois.pie...@overbyte.be Embarcadero MVP http://www.overbyte.be http://francois-piette.blogspot.com -- 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] Delphi TServerSocket vs ICS equivalent
> How the messages are sent to me is out of my control. But the client will not send me another > message until the previous one has been acknowledged. If I don't respond at all the client will > timeout, close the socket connection, re-open it and send the original message again. If your XML message has no delimiter, then you must parse it on the fly - which is possible - so that you know when it is complete and time to process it. This is a perfectly usable strategy but this is not what is usually done. Usually, either there is a delimiter at the end of the data, or there is a length expressed in front of data. The receiver then knows when everything has been received without any knowledge - beside length or delimiter - of the "message" content. This helps building a layered application where transport and processing is clearly distinguished. Of course those considerations are not dependent on the component used. What you use with the old component is for sure good for ICS component as well. -- francois.pie...@overbyte.be Embarcadero MVP http://www.overbyte.be http://francois-piette.blogspot.com -- 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] Delphi TServerSocket vs ICS equivalent
Ah, lousy data handling ;) Well, since you already had something working, I assume you'll figure it out :) Merijn On 8-10-2013 13:43, Graham Powell wrote: How the messages are sent to me is out of my control. But the client will not send me another message until the previous one has been acknowledged. If I don't respond at all the client will timeout, close the socket connection, re-open it and send the original message again. Graham -Original Message- From: Merijn Bosma [mailto:bo...@xs4all.nl] Sent: 08 October 2013 12:18 To: ICS support mailing Cc: Graham Powell Subject: Re: [twsocket] Delphi TServerSocket vs ICS equivalent Do you have good separation between the different XML blocks on data level? Merijn On 8-10-2013 13:14, Graham Powell wrote: XML data will be received. After I have processed it, I will need to send an XML message back (containing ACK or NACK) to the client. Looks like LineMode=false is what I need. Thanks again Graham -Original Message- From: TWSocket [mailto:twsocket-boun...@lists.elists.org] On Behalf Of Angus Robertson - Magenta Systems Ltd Sent: 08 October 2013 12:04 To: twsocket@lists.elists.org Subject: Re: [twsocket] Delphi TServerSocket vs ICS equivalent I assume I can set the component not to filter anything incoming. I will be receiving shed loads of XML type data with CR LFs optional. The two main decisions using TSocketServer are whether to send a banner on answer (which upsets many clients) and whether to use LineMode to receive data. LineMode=true is for short line oriented protocols and is easy to implement, but you receive nothing until a LineEnd (defaults to CRLF) appears. So LineMode=false is safer and you receive random sized buffers which you process as you wish. Angus -- 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] Delphi TServerSocket vs ICS equivalent
How the messages are sent to me is out of my control. But the client will not send me another message until the previous one has been acknowledged. If I don't respond at all the client will timeout, close the socket connection, re-open it and send the original message again. Graham -Original Message- From: Merijn Bosma [mailto:bo...@xs4all.nl] Sent: 08 October 2013 12:18 To: ICS support mailing Cc: Graham Powell Subject: Re: [twsocket] Delphi TServerSocket vs ICS equivalent Do you have good separation between the different XML blocks on data level? Merijn On 8-10-2013 13:14, Graham Powell wrote: > XML data will be received. After I have processed it, I will need to > send an XML message back (containing ACK or NACK) to the client. > Looks like LineMode=false is what I need. > > Thanks again > Graham > > -Original Message- > From: TWSocket [mailto:twsocket-boun...@lists.elists.org] On Behalf Of > Angus Robertson - Magenta Systems Ltd > Sent: 08 October 2013 12:04 > To: twsocket@lists.elists.org > Subject: Re: [twsocket] Delphi TServerSocket vs ICS equivalent > >> I assume I can set the component not to filter anything incoming. I >> will be receiving shed loads of XML type data with CR LFs optional. > The two main decisions using TSocketServer are whether to send a > banner on answer (which upsets many clients) and whether to use > LineMode to receive data. > > > LineMode=true is for short line oriented protocols and is easy to > implement, but you receive nothing until a LineEnd (defaults to CRLF) > appears. So LineMode=false is safer and you receive random sized > buffers which you process as you wish. > > Angus > > -- > 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] Delphi TServerSocket vs ICS equivalent
Do you have good separation between the different XML blocks on data level? Merijn On 8-10-2013 13:14, Graham Powell wrote: XML data will be received. After I have processed it, I will need to send an XML message back (containing ACK or NACK) to the client. Looks like LineMode=false is what I need. Thanks again Graham -Original Message- From: TWSocket [mailto:twsocket-boun...@lists.elists.org] On Behalf Of Angus Robertson - Magenta Systems Ltd Sent: 08 October 2013 12:04 To: twsocket@lists.elists.org Subject: Re: [twsocket] Delphi TServerSocket vs ICS equivalent I assume I can set the component not to filter anything incoming. I will be receiving shed loads of XML type data with CR LFs optional. The two main decisions using TSocketServer are whether to send a banner on answer (which upsets many clients) and whether to use LineMode to receive data. LineMode=true is for short line oriented protocols and is easy to implement, but you receive nothing until a LineEnd (defaults to CRLF) appears. So LineMode=false is safer and you receive random sized buffers which you process as you wish. Angus -- 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] Delphi TServerSocket vs ICS equivalent
XML data will be received. After I have processed it, I will need to send an XML message back (containing ACK or NACK) to the client. Looks like LineMode=false is what I need. Thanks again Graham -Original Message- From: TWSocket [mailto:twsocket-boun...@lists.elists.org] On Behalf Of Angus Robertson - Magenta Systems Ltd Sent: 08 October 2013 12:04 To: twsocket@lists.elists.org Subject: Re: [twsocket] Delphi TServerSocket vs ICS equivalent > I assume I can set the component not to filter anything incoming. I > will be receiving shed loads of XML type data with CR LFs optional. The two main decisions using TSocketServer are whether to send a banner on answer (which upsets many clients) and whether to use LineMode to receive data. LineMode=true is for short line oriented protocols and is easy to implement, but you receive nothing until a LineEnd (defaults to CRLF) appears. So LineMode=false is safer and you receive random sized buffers which you process as you wish. Angus -- 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] Delphi TServerSocket vs ICS equivalent
> I assume I can set the component not to filter anything incoming. I > will be receiving shed loads of XML type data with CR LFs optional. The two main decisions using TSocketServer are whether to send a banner on answer (which upsets many clients) and whether to use LineMode to receive data. LineMode=true is for short line oriented protocols and is easy to implement, but you receive nothing until a LineEnd (defaults to CRLF) appears. So LineMode=false is safer and you receive random sized buffers which you process as you wish. Angus -- 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] Delphi TServerSocket vs ICS equivalent
Thanks, I think the OverbyteIcsTcpSrv.dpr demo shows everything I need to start experimenting. I assume I can set the component not to filter anything incoming. I will be receiving shed loads of XML type data with CR LFs optional. Graham -Original Message- From: TWSocket [mailto:twsocket-boun...@lists.elists.org] On Behalf Of Angus Robertson - Magenta Systems Ltd Sent: 08 October 2013 10:04 To: twsocket@lists.elists.org Subject: Re: [twsocket] Delphi TServerSocket vs ICS equivalent > What I am wondering is would I be better off using one of the ICS > socket components for this. Maybe TWSocket or TWSocketServer. The latter. > If so, what is the best demo to show how these components are used OverbyteIcsTcpSrv.dpr is the main socket server demo, which works with OverbyteIcsCliDemo.dpr. You can also look at several ICS high level servers that use Socket Server, SMTP Server, FTP Server and HTTP Server. For speed, you can use my IP Log Streaming Component which will allow you to make a working server (or client) in a couple of minutes without being too concerned about all the component events. http://www.magsys.co.uk/delphi/magics.asp Angus -- 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] Delphi TServerSocket vs ICS equivalent
> What I am wondering is would I be better off using one of the ICS > socket components for this. Maybe TWSocket or TWSocketServer. The latter. > If so, what is the best demo to show how these components are used OverbyteIcsTcpSrv.dpr is the main socket server demo, which works with OverbyteIcsCliDemo.dpr. You can also look at several ICS high level servers that use Socket Server, SMTP Server, FTP Server and HTTP Server. For speed, you can use my IP Log Streaming Component which will allow you to make a working server (or client) in a couple of minutes without being too concerned about all the component events. http://www.magsys.co.uk/delphi/magics.asp Angus -- 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
[twsocket] Delphi TServerSocket vs ICS equivalent
Hello, I am currently using the Delphi TServerSocket to just sit and listen for data from a number of clients. I have an array of strings into which the data from each client is stored and subsequently processed. I know that over the years that Delphi has removed some of the functionality from the TServerSocket, but on the whole this scheme seems to work. What I am wondering is would I be better off using one of the ICS socket components for this. Maybe TWSocket or TWSocketServer. If so, what is the best demo to show how these components are used, particularly with respect to getting the data from the read event, identifying from which client it has come from and then sending a reply back to that client up the open socket connection it has created. Any help much appreciated Graham -- 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