Re: [twsocket] Making ServerClass of THttpServer and TFtpServerproperty
Yes, Right+Click|TortoiseSVN|RepoBrowser. From the RepoBrowser, you specify the URL to the repository. If you happen to be in any sub-node within the repository, just change to a parent node and hit F5 to reload it, and it will show all children nodes. -dZ. --- Original Message --- From: Fastream Technologies[mailto:[EMAIL PROTECTED] Sent: 11/19/2008 1:52:33 PM To : twsocket@elists.org Cc : Subject : RE: Re: [twsocket] Making ServerClass of THttpServer and TFtpServerproperty OT: Is there any way to browse the contents of SVN repository from Tortoise? Regards, SZ On Wed, Nov 19, 2008 at 2:38 PM, Arno Garrels [EMAIL PROTECTED] wrote: Fastream Technologies wrote: Yes we plan to update to v7. I just need to know whether it would work with BCB2007 or do I have to update to BCB2009 for FTPS/HTTPS Server components? It should work with CB2007, checkout latest SVN revision from /branches/icsv7/. -- Arno Garrels On Tue, Nov 18, 2008 at 7:40 PM, Francois PIETTE [EMAIL PROTECTED]wrote: I doubt that Francois wants such basic changes in V6 which is a release candidat now. Indeed. Probably SZ could already use V7 ? V7 is the workhorse ! -- [EMAIL PROTECTED] The author of the freeware multi-tier middleware MidWare The author of the freeware Internet Component Suite (ICS) http://www.overbyte.be - Original Message - From: Arno Garrels [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Tuesday, November 18, 2008 5:47 PM Subject: Re: [twsocket] Making ServerClass of THttpServerandTFtpServerproperty Fastream Technologies wrote: If we decide to sponsor such a coding job, would any of you guys do it for the benefit of all? If so, for how much USD and days? Now that the V7 FTP server uses the TWSocketServer (thanks Angus) it's an easy task. I'm sure you code that in a few minutes, look at how it is done with the client class and you get the idea. If you want it for V6 the Ftp server needs to be rewritten first which was much more work (I doubt that Francois wants such basic changes in V6 which is a release candidat now). -- Arno Garrels Best Regards, SZ On Sat, Nov 1, 2008 at 9:12 PM, Angus Robertson - Magenta Systems Ltd [EMAIL PROTECTED] wrote: Angus already made an attempt to rewrite the FTP server, but it never made it into the ICS package :( I do finally shortly expect to start adding UTF-8 and a couple of new commands to the V7 FTP server, and there's no reason that can be based on the SocketServer version, leaving the V6 version using the legacy private server. 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 -- 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] THttpCli.Head bug
I just tested this using telnet, and just typing HEAD (even if the request is invalid) will cause the transaction to fail in a weird way. My guess is that the problem is at the gateway (perhaps a proxy configuration issue?), or maybe the HTTP server itself. -dZ. --- Original Message --- From: Francois PIETTE[mailto:[EMAIL PROTECTED] Sent: 11/5/2008 12:35:24 PM To : twsocket@elists.org Cc : Subject : RE: Re: [twsocket] THttpCli.Head bug Please use the ICS HttpTst and HEAD to, http://secure.iconsole.org/login.ews GET works HEAD fails--causes trouble for our reverse proxy. Any ideas? I can reproduce the issue, even with command line telnet. IMO it is a bug of that website. login.ews probably correspond to a script which crashes with the head command. -- [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] THttpCli.Head bug
When I telneted in, I typed HEAD and hit ENTER with no proper request string (no document resource) and it got stuck. I did the same thing with GET and I got the standard error for a bad request. I thought it was our proxy here. There seems to be something wrong with the server then. -dZ. --- Original Message --- From: Fastream Technologies[mailto:[EMAIL PROTECTED] Sent: 11/5/2008 12:56:32 PM To : twsocket@elists.org Cc : Subject : RE: Re: [twsocket] THttpCli.Head bug There is no proxy in between now. It must be a web server issue as the jpg also does not respond to head!. On Wed, Nov 5, 2008 at 6:50 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I just tested this using telnet, and just typing HEAD (even if the request is invalid) will cause the transaction to fail in a weird way. My guess is that the problem is at the gateway (perhaps a proxy configuration issue?), or maybe the HTTP server itself. -dZ. --- Original Message --- From: Francois PIETTE[ mailto:[EMAIL PROTECTED] Sent: 11/5/2008 12:35:24 PM To : twsocket@elists.org Cc : Subject : RE: Re: [twsocket] THttpCli.Head bug Please use the ICS HttpTst and HEAD to, http://secure.iconsole.org/login.ews GET works HEAD fails--causes trouble for our reverse proxy. Any ideas? I can reproduce the issue, even with command line telnet. IMO it is a bug of that website. login.ews probably correspond to a script which crashes with the head command. -- [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 -- Gorkem Ates Fastream Technologies Software IQ: Innovation Quality www.fastream.com | Email: [EMAIL PROTECTED] | Tel: +90-312-223-2830 | MSN: [EMAIL PROTECTED] Join IQWF Server Yahoo group at http://groups.yahoo.com/group/IQWFServer Join IQ Reverse Proxy Yahoo group at http://groups.yahoo.com/group/IQReverseProxy -- 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] OT: Is the list still alive?
I received your message fine. Yet, it is indeed strange that there haven't been any messages for a week. -dZ. --- Original Message --- From: Arno Garrels[mailto:[EMAIL PROTECTED] Sent: 10/29/2008 12:46:34 PM To : twsocket@elists.org Cc : Subject : RE: [twsocket] OT: Is the list still alive? Hi, Six days no messages, very strange... -- 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] TTcpDaemon in ICS V7
I think you should be able to use conditional compiler directives for that. I believe there's a file included with the ICS distribution that defines various delphi compiler versions and such. -dZ. --- Original Message --- From: Jon Robertson[mailto:[EMAIL PROTECTED] Sent: 10/3/2008 12:43:16 PM To : twsocket@elists.org Cc : Subject : RE: Re: [twsocket] TTcpDaemon in ICS V7 I changed the file naming scheme to the V7 scheme and changed a few char in [] to CharInSet(). I think those were the only changes. These demos work great for me in D2009. Argh, it just dawned on me that the CharInSet changes will only work with D2009. Anyone else should change that back to char in [] I'm still wrapping my head around Unicode and will be for a while. I'm almost comfortable just leaving things alone, taking for granted that most of what I'm used to in D6 will just work. Jon -- 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] Early web server response
QUOTE: I not convinced of this. The title of the section is Monitoring Connections for Error Status Messages. So when it say SHOULD monitor the network connection for an error status I think that it refers to the connection itself and not to an error reported by the server. Wow, you bring a very interesting point. I was interpreting error status as an error response, but now I think you are right: it seems to mean that the connection must be dropped when the TCP/IP connection itself fails while transmitting. I don't know how I missed this. If this is the case, then early error responses are not supposed to happen (since, as I said before, they do not seem to be mentioned anywhere). QUOTE: So the connection and what the server send are two different thinks. I consider sees the connection close one of the possible results of monitor the network connection for an error status. Yes, you are right. I'm sorry, I appear to have misunderstood the semantics of section 8.2.2 of the RFC. QUOTE: Yes. I waited at least one minute before confirm the authentication form. What WireShark showed me is that the request was incomplete and the second try was made with a new connection. If I confirm immediately then all is done in the same connection, and of course the re-send is made after the first is completed. I'm sorry but I'm confused. What caused IE to open a new connection? When you say I confirm, do you mean that you submit a username and password when IE prompted you? Perhaps the new connection is because of a very short nonce time-out? QUOTE: I repeat the same with Firefox (3.0.2) with similar result. The difference seems that FF ask for user and password after it has finished to send the request. Effectively I get the password request a bit later compared to IE. Even FF do a new connection if I wait to confirm the authentication form. In that case I see in WS that the first request is sent entirely. OK, so it is what we have suspected all along: Both browsers receive the early 401 response but continue sending the full content, and then re-send the request with the authorization headers. The difference is that IE prompts the user as soon as it receives the response (early), while Firefox waits until it finishes transmitting the body (late). I think then that Arno's solution would work, since it seems to have the same effect: delay the re-try until after the body is sent completely. I still think this offers a vector for Denial-Of-Service attacks. However, sending the response early does not protect you since, as we saw, the client is free to delay reacting to the response. I agree with you that if this was the concern of Tomcat, it would have closed the connection. So why does Tomcat respond early? -dZ. -- 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] Early web server response
QUOTE: Yes, but the response came while the body was in transit already, before it was sent completely, which puts the transaction in a very unstable state. This is the reason why the RFC requires the client (i.e. it says it MUST) close the connection if the Content-Length header was used. Can you point me where the rfc say this? Is it the 8.2.2? Yes, section 8.2.2 says: [...] If the client sees an error status, it SHOULD immediately cease transmitting the body. If the body is being sent using a chunked encoding (section 3.6), a zero length chunk and empty trailer MAY be used to prematurely mark the end of the message. If the body was preceded by a Content-Length header, the client MUST close the connection. http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.2.2 As I mentioned in my previous message, I believe that this requirement is because the server responded early for a reason: it rejected the request, so sending the rest of the body to satisfy the Content-Lenght would go against the wishes of the server. As we have seen, to compensate for this, the server accepts the body, but silently discards it (at least that seems to be the behaviour). This means that the server is wasting resources in attending a rejected request. QUOTE: You said that the client MUST close the connection when receive the 401. Is the section above that you are referring? Ah! I'm very sorry, but I think you may have misunderstood me. I said that the RFC (section 8.2.2, as quoted above) states that IF an error response is received early AND a Content-Length header was used THEN the client MUST close the connection. QUOTE: What is still not clear to me is: sending the response before the client has finished to send the request break the rfc or not? No. Sending the response before the client has finished sending the request is allowed by the RFC. This is also in secion 8.2.2: An HTTP/1.1 (or later) client sending a message-body SHOULD monitor the network connection for an error status while it is transmitting the request. I can't find any place where it explicitly states that responses can come before the end of the request. Nor can I find a place where it explicitly states that the server must receive the full request before sending a response. The RFC seems to imply that the standard way is for a response to follow the full request; but parts like section 8.2.2 seem to imply that this is not a requirement. For example, in section 6: After receiving and interpreting a request message, a server responds with an HTTP response message. It does not expressly say that the server must respond at the end of the request, just after interpreting it. Arguably, an unauthorized request for a resource that requires authentication can be clearly interpreted and identified as soon as the headers are received and processed. In any case, the wording in section 8.2.2 seems to suggest it strongly. QUOTE: If this was for security reasons why the server doesn't close the connection? As it is actually it receive the rest of the request (at least if made by IE). Exactly, it's a tricky situation. On the one hand, the server does not want to process a lengthy request which it *knows* is invalid. On the other hand, it is bound by the RFC to receive the full length of the body, as specified in the Content-Length header. The RFC therefore puts the responsibility on the client by saying that it MUST close the connection in such cases. If the client closes the connection, then everything falls into place: The client can re-connect and re-send the request with the appropriate authentication header (if it has the credentials), and the server can easily ignore the previous unauthorized request. All is well except for NTLM, which requires the connection to be kept open. By the way, when I said security reasons, I meant to prevent a Denial-Of-Service attack. QUOTE: If a Content-Length header was provided, the client MUST close the connection. IE don't do so, but works (ok, it is a M$ product, following the rules is not very frequent ;). Are we confident that IE received the response early? Perhaps it defers acknowledging responses until after the body is fully sent. (The RFC does say that the client SHOULD monitor for early error responses, it does not say they MUST.) Also, as we have seen, the RFC seems a little vague in this regard, so it is entirely possible that this particular exceptional case was not considered too much. RFC 2616 does not discuss authentication at all, it was deferred to RFC 2617; but that RFC does not consider transport problems (since that is part of RFC 2616). Furthermore, RFC 2616 has this to say about Denial Of Service Attacks: They exist. They are hard to defend against. Research continues. Beware. Which does not help much. In any case, if it works for IE, it can work for us. Perhaps Firefox works the same way. We could
Re: [twsocket] Early web server response
Maurizio, Is this test server the Tomcat server where the issue manifested before? QUOTE: At this point the problem seems quite different. The early receive of the 401 interrupt the sending of the body. So the server drop what receive until the content length is reached, and then consider the rest as a new request. === END I'm not sure I understand. Do you mean that the server did send an early 401 response but allowed the client to send up to Content-Length-amount of data? So, then there's no problem, right? I though that as soon as it sent the response, all the rest of the request (the body) was being treated as a new request from the server and failing as invalid. Unless you were sending more data than you specified in the Content-Length before... I'm confused. I don't have access to WireShark right now, so I can't really test this at the moment. -dZ. --- Original Message --- From: Maurizio Lotauro[mailto:[EMAIL PROTECTED] Sent: 9/23/2008 12:32:24 PM To : twsocket@elists.org Cc : Subject : RE: Re: [twsocket] Early web server response Scrive Maurizio Lotauro [EMAIL PROTECTED]: Scrive DZ-Jay [EMAIL PROTECTED]: [...] In any case, I'll see if I can do some experiments with IE and Tomcat and let you know what I find. Please wait, I asked to our server admin to prepare a test environment public available (I need it for myself). Probably it will be ready tomorrow. I have a public server that show the problem. Who is interested write me an email. I made some test with a test application and IE. The latter works. Analyzing the communication with WireShark it seems that it works because IE complete to send the whole body before resend the request including the authorization info. At this point the problem seems quite different. The early receive of the 401 interrupt the sending of the body. So the server drop what receive until the content length is reached, and then consider the rest as a new request. I have a modified version of THttpCli that show automatically a user/pwd request when the status code is 401/407 (and cache it). In fact if I wait to give user and pwd then it works because in the meantime the whole body is sent. So the solution seems wait that the body is sent before retrying. Bye, Maurizio. -- 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] Early web server response
So, if I understand correctly, part of the body was sent after the 401 response (that which was in the send buffer already), and the remainder was sent after the authentication header was sent? This is weird. It means that the server accepted the (invalid) data that was sent after a non-authenticated request. This smells like a security vulnerability. Or am I misunderstanding it? -dZ. --- Original Message --- From: Arno Garrels[mailto:[EMAIL PROTECTED] Sent: 9/23/2008 2:25:24 PM To : twsocket@elists.org Cc : Subject : RE: Re: [twsocket] Early web server response Arno Garrels wrote: 3) IE then sends just the header with the credentials and continues posting the rest of the data. :-) Should read IE then sends just the header with credentials and continues posting remaining data. -- Arno -- 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] Early web server response
Ok, that makes more sense. And, just to make sure I understand, here's the sequence of events: 1. IE Sends request without auth information. 2. Server responds with 401 after the headers are received. 3. IE continues sending whatever was in send buffer (up to Content-Lenght bytes) but stops when the 401 response is received. 4. Server receives the bad data (whatever IE sent after the 401 response) and discards it without problem (up to Content-Length bytes). 5. IE then pauses to ask the user for login information. 6. IE re-sends the request with valid auth credentials and the entire payload as normal. 7. Server authenticates the connection and accepts the request. Is the above accurate? If so, then what is the problem? If the server silently discards the payload data from the unauthorized request, then surely there is no problem with HttpCli, unless it is sending more than Content-Length data and the server is interpreting the extraneous data as a new request. -dZ. --- Original Message --- From: Arno Garrels[mailto:[EMAIL PROTECTED] Sent: 9/23/2008 3:04:54 PM To : twsocket@elists.org Cc : Subject : RE: Re: [twsocket] Early web server response [EMAIL PROTECTED] wrote: So, if I understand correctly, part of the body was sent after the 401 response (that which was in the send buffer already), and the remainder was sent after the authentication header was sent? My mistake, there are too many packets in the log. Actually IE resends everything when it received the 401 response. -- Arno -- 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] Early web server response
--- Original Message --- From: Maurizio Lotauro[mailto:[EMAIL PROTECTED] Sent: 9/19/2008 8:12:30 AM To : twsocket@elists.org Cc : Subject : RE: Re: [twsocket] Early web server response How I can avoid the second chunk or tell the server that I'm starting a new send? The RFC provides the answer: If the body is being sent using a chunked encoding (section 3.6), a zero length chunk and empty trailer MAY be used to prematurely mark the end of the message. If the body was preceded by a Content-Length header, the client MUST close the connection. Thus, if you are sending the body preceded by a Content-Length header (which is, I believe, the way the HttpCli sends by default), then you must close the connection immediately after detecting an error, in order to start a new one. The server may receive the particular chunk that was in transit eventually, but since you closed the connection, it won't respond to it. -dZ. -- 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] Early web server response
--- Original Message --- From: Maurizio Lotauro[mailto:[EMAIL PROTECTED] Sent: 9/19/2008 10:25:03 AM To : twsocket@elists.org Cc : Subject : RE: Re: [twsocket] Early web server response I cannot close the connection, it will not work with NTLM authentication. I'm sorry, but I don't understand. I must be missing something. As soon as you detect the error response, you close the socket, then re-connect and re-send the request with the appropriate authentication header. Granted, this is not currently supported directly by the component, but I don't see a problem in modifying it to do this. By that I mean that it may be a challenge to do so, and it may be a hack, but it's not insurmountable. Perhaps an event can be triggered after the headers are sent and an error response is received. The application can then decide, based on the error code, whether to close and retry with authentication credentials, or just close and fail. But this is all in theory, as I haven't seen the HttpCli code in a couple of years. -dZ. -- 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] Early web server response
Thank you. I understand then. That obviously invalidates my suggestion. However, I wonder how this works in practice. I mean, how do regular browsers deal with it? The RFC specifically states that if you receive an error after the headers, and you used a Content-Length header, you MUST (their emphasis) drop the connection. Perhaps it's done with chunking? -dZ. --- Original Message --- From: Fastream Technologies[mailto:[EMAIL PROTECTED] Sent: 9/19/2008 12:54:58 PM To : twsocket@elists.org Cc : Subject : RE: Re: [twsocket] Early web server response What you miss is NTLM 401 response includes some random data that must be returned with the request in the same connection. Otherwise value would be lost at server side!! -- 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] Early web server response
Hello: Seems to be a server issue. Even if the server requires authentication, the response should not be sent until the entire request is received. This behaviour is very strange indeed. Are you sure that the response is sent before the XML file is sent completely (i.e. the request is completed)? -dZ. --- Original Message --- From: Maurizio Lotauro[mailto:[EMAIL PROTECTED] Sent: 9/17/2008 12:48:50 PM To : twsocket@elists.org Cc : Subject : RE: [twsocket] Early web server response Hello, it seems that I have a problem with the HttpCli component. The client send an xml to the server using the POST method (synch). The server require an authentication (basic). When the xml is greater than a certain size (160k are enough) the server answer with a 400 (IIS/Tomcat: Bad request) or 414 (Apache/Tomcat: URI too long) status code. I analyzed the communication using WireShark and this is what I observed. The server answer with 401 before the client has finished to send the xml. The client continue to send the rest of xml, but the server think that it is a new request and then return the error. At this point the client stop and raise an exception. I'm using ICS V5 (not the last one because I'm using a customized version). Is it a known problem solved in a more recent version? Bye, Maurizio. -- 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] Early web server response
Hello: It occurs to me that it could be a mechanism to protect from a DOS attack. Consider the following attack vector: You encounter a server which requires authentication for a resource. You then flood the server with POST requests with very large payloads, requiring the server to receive the entire request before formulating the 401 response. With a large enough flood, you can overwhelm the server and cause denial of service. I guess a way to overcome this in the client side would be to send a HEAD request prior to establish if the resource is available for consumption. If not, the server will respond with 401 and your client can then send the appropriate authentication credentials. Also, if the server is responding prematurely, doesn't it mean that the request connection was aborted? And if this is the case, shouldn't the HttpCli component detect this and stop sending? This still won't prevent any data currently in transit from generatinga 402 error response when it arrives at the server. -dZ. --- Original Message --- From: Maurizio Lotauro[mailto:[EMAIL PROTECTED] Sent: 9/17/2008 1:10:47 PM To : twsocket@elists.org Cc : Subject : RE: Re: [twsocket] Early web server response Yes. Using Follow TCP Stream of WireShark I see the answer in the middle of the request. Then I checked the single packet (ordered by time) and it is effectively so. This happen by a customer that use IIS, then I reproduced it on our server (that use Apache). Maybe a Tomcat issue? Bye, Maurizio. -- 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] Early web server response
Hello: Actually, I just found that this is defined in the RFC (probably to prevent DOS attacks): 8.2.2 Monitoring Connections for Error Status Messages http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.2.2 An HTTP/1.1 (or later) client sending a message-body SHOULD monitor the network connection for an error status while it is transmitting the request. If the client sees an error status, it SHOULD immediately cease transmitting the body. If the body is being sent using a chunked encoding (section 3.6), a zero length chunk and empty trailer MAY be used to prematurely mark the end of the message. If the body was preceded by a Content-Length header, the client MUST close the connection. If this is not the current behaviour of the HttpCli component, then perhaps we can work in implementing this. -dZ. -- 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] OT: Getting bounces from every post I send (WAS: We are currently on a Holiday break.)
--- Original Message --- From: Maurizio Lotauro[mailto:[EMAIL PROTECTED] Sent: 9/17/2008 2:28:05 PM To : twsocket@elists.org Cc : Subject : RE: Re: [twsocket] We are currently on a Holiday break. Am I the only one? No, I am also getting the same message for every message I send to the list. Francois, could you look into this? -dZ. -- 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] ICS-SSL now released as freeware. ICS is ready for Tiburon. Version Control repository for ICS
thats great. is it possible to use ssl and non-ssl at the same time? i.e. for a pop3 client that can connect to a aecure and a nonsecure server ? Here are a few things worth mentionning :-) ICS-SSL === As promised long time ago, ICS-SSL is now going public. It means everybody will have free access to the source code. ICS-SSL is nearly finished. It is already used by more than 150 contributors, many in real commercial application with great success. ICS-SSL would never have happened without all those contributors, among two of them I would like to specially thanks: Arno Garrels and Angus Robertson. Arno has done a really incredible work in designing many parts of ICS-SSL while Angus has done some development and a lot of testing and bug fixing. Of course, I would also thanks developers that contributed financially. Without that money I would not have been able to work as much on the project. The project is not finished ! It will simply now released to the freeware community with the secret hope that a lot of developers will contribute to the development. SSL enabled components are just the regular components with SSL code magically inserted using a conditionla symbol. In short, define use_ssl and suddently your ICS components are enabled for SSL. There are some demos in SslInternet folder. It is not possible to explain everything here. Please use the support mailing list to ask for help. ICS-V7 == Angus Robertson, Arno Garrels and Francois Piette are proud to announce the new ICS-V7 also known as ICS for Tiburon. Actually you need to have access to Delphi 2009 to use the new unicode features but previous Delphi/BCB versions are still OK of course. V7 is at alpha level and currently efforts are concentrated on Delphi 2009. Basically, ICS-V7 is ICS-V6 with partial unicode support. Currently the components are working mostly as before while using unicode strings. This will allows you to port your current applications to Delphi 2009 and of course write new applications. We hope to fully support unicode soon. We will be happy to have help from any ICS community member. ICS-V6 == This is the version you should use today or at least very soon tommorow. Currently there is a release candidate available for download at www.overbyte.be. ICS-V5 == This is the old version. It is still there to support old applications. Forget it for new one. No new development will take place and migration to ICS-V6 is easy. VERSION CONTROl REPOSITORY == To ease the development, for both ICS and ICS-SSL, there is now a SVN repository. Again, I would like to thanks Arno and Angus who both made it possible. Angus providing the hosting while Arno providing the management. The repository actually contains ICS-V5, ICS-V6 and ICS-V7. The SSL stuff has been merged into the regular ICS code so there is only one code base. The SSL code is compiled when the symbol use_ssl is defined for your project. To access the repository, you need to use a subversion client. For example TortoiseSVN (http://tortoisesvn.net/) which is very good and OpenSource. Once your SVN client is installed, for ICS-V6 you can browse to svn://svn.overbyte.be/ics or http://svn.overbyte.be:8443/svn/ics or for ICS-V5 to: svn://svn.overbyte.be/icsv5 or http://svn.overbyte.be:8443/svn/icsv5. ICS-V7 is a part of V6, in ics/branches/icsv7. All use usercode = ics and password = ics for read access. Write access is only available to TeamICS. SVN works by keeping a local development directory in synchronism with the repository directory. TortoiseSVN integrates into Windows Explorer, navigate to the local directory to which ICS will be downloaded, right click in Explorer and take SVN Checkout, enter the URL from above, ensure the local directory is correct and click to download the files. Subsequent changes are found by right clicking in the root and taking SVN Update which will just download anything changed or new. You are really welcome to participate in the development and submit your fixes and changes. To do so, simply use TortoiseSVN diff file facility and make your changes available somewhere and announce it in the support mailing list (or mail it to one of TeamICS member). If you need help, please use the support mailing list. Best regards -- [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] Post command...
Mark, If what you want is to let the user know that processing has completed, what you need to do is quite simple, old school CGI processing: You change the rendered output to reflect the results of processing. After finishing processing, change a variable, say, resultString, and display it in the rendered output. You can have something like: // Notice the call to GetResultString() to inject server output. AnswerString(Flags, '', { Default Status '200 OK' } '', { Default Content-Type: text/html } '', { Default header } 'HTML' + 'HEAD' + 'TITLE' + TitleString + '/TITLE' + '/HEAD' + 'BODY style=background:' + serverHTMLBGColor + '' + GetResultString(resultString) + 'form action=AC method=post' + //accept command action 'pTag:' + tagName + ' ' + cBackButton + '/p' + 'pHigh Limit: ' + highEU + '/p' + 'pLow Limit: ' + lowEU + '/p' + 'input name=Tagname type=hidden value=' + tagname + '/' + 'input name=ItemID type=hidden value=' + itemIDString + '/' + 'input name=UserValue type=text value=' + currentValue + '/br/' + 'input name=AcceptBtn type=submit value=Accept/' + '/form' + '/HTML'); // --- Function GetResultString(str: String): String Begin If (str '') Then Result := 'Server Responded: '+ str Else Result := ''; End If End; // -- END When the page is first rendered, the GetResultString() function will return an empty string because the resultString hasn't been set. And when the data is posted and processed, it will display the new string. This is pretty much how more complex and sophisticated frameworks, like ASP.NET, Java-Struts, and PHP handle dynamically generated pages. What Francois was offering was a more modern and popular approach, usually called AJAX, where your web page sends requests to the server on a separate channel, using JavaScript, then parses the output, and dynamically changes the document displayed. It does the same thing without refreshing the entire document. However, as you stated, this may not work in exactly the same way on every browser, and depends too much on client-side processing, which is prone to errors and abuse. -dZ. zayin wrote: Hi, This all has to be done in HTML only. This is my first HTML programming task so, I do not know how to make the command from an invisible frame or layer. This is the page. AnswerString(Flags, '', { Default Status '200 OK' } '', { Default Content-Type: text/html } '', { Default header } 'HTML' + 'HEAD' + 'TITLE' + TitleString + '/TITLE' + '/HEAD' + 'BODY style=background:' + serverHTMLBGColor + '' + 'form action=AC method=post' + //accept command action 'pTag:' + tagName + ' ' + cBackButton + '/p' + 'pHigh Limit: ' + highEU + '/p' + 'pLow Limit: ' + lowEU + '/p' + 'input name=Tagname type=hidden value=' + tagname + '/' + 'input name=ItemID type=hidden value=' + itemIDString + '/' + 'input name=UserValue type=text value=' + currentValue + '/br/' + 'input name=AcceptBtn type=submit value=Accept/' + '/form' + '/HTML'); Can you advise? -- 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] Post command...
Mark, First you need to understand how HTTP works: It is a stateless protocol, and it works in a request-response cycle. The stateless part means that it doesn't retain any information about any previous requests or responses, and that every request is treated as a completely new one. The second part means that when the client sends a request, the browser returns a response. When you use a browser as a client, a request is any URL you enter in the address bar or hyperlink you click on, which is sent to the server; and this causes a response from the server, which, depending on the type of resource it returns, is treated in a specific way. For instance, an HTML resource is rendered as a web page, and a JPEG resource is rendered as an image. Every request expects a response, this is the way the protocol was designed, so there is no clear way to say to the server Do this and then don't give me anything back. But then whatever the server gives back to the browser, the browser will try to interpret it as best as it can -- even if you make the server return an empty resource, the browser will just display an empty web page. This is clearly not what you want. For this reason what is typically done is that when a page requests some processing from the server that should return nothing or cause no change, the server returns the original content so that the browser can render it equally as if nothing happened. That's what I was showing how to do. This is a typical state-machine type of application, where depending on the state of the application (either first request, or form post), the server does something different. An alternative is to not use the browser directly to perform the request for processing, but to use JavaScript, as Francois suggested. This way, whatever the server responds -- and it will *always* respond with something -- you can throw it away or interpret it as you want (using JavaScript). The point is that in order for the browser to stop waiting, the server has to respond with something -- *anything* (even an empty response body, just the headers); and whatever it responds with, the browser will try to act upon it. A web application is not the same as a Win32 application. dZ. zayin wrote: Hi, Thanks for the information. What I am looking to do is just stop the client browser from waiting. I do not want to change the page. In the two environments I am testing in, at present, IE and Mozilla, after the user presses the accept button the browser waits for a reply. With IE the tabsheet title shows a spinning circle. With Mozilla it sets the cursor to the pointer+hourglass. After the HandlePostedData I do not know what to send to handle the client so the client stop this wait mode. Ciao, Mark -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Monday, April 14, 2008 10:54 AM To: twsocket@elists.org Subject: Re: [twsocket] Post command... Mark, If what you want is to let the user know that processing has completed, what you need to do is quite simple, old school CGI processing: You change the rendered output to reflect the results of processing. After finishing processing, change a variable, say, resultString, and display it in the rendered output. You can have something like: // Notice the call to GetResultString() to inject server output. AnswerString(Flags, '', { Default Status '200 OK' } '', { Default Content-Type: text/html } '', { Default header } 'HTML' + 'HEAD' + 'TITLE' + TitleString + '/TITLE' + '/HEAD' + 'BODY style=background:' + serverHTMLBGColor + '' + GetResultString(resultString) + 'form action=AC method=post' + //accept command action 'pTag:' + tagName + ' ' + cBackButton + '/p' + 'pHigh Limit: ' + highEU + '/p' + 'pLow Limit: ' + lowEU + '/p' + 'input name=Tagname type=hidden value=' + tagname + '/' + 'input name=ItemID type=hidden value=' + itemIDString + '/' + 'input name=UserValue type=text value=' + currentValue + '/br/' + 'input name=AcceptBtn type=submit value=Accept/' + '/form' + '/HTML'); // --- Function GetResultString(str: String): String Begin If (str '') Then Result := 'Server Responded: '+ str Else Result := ''; End If End; // -- END When the page is first rendered, the GetResultString() function will return an empty string because the resultString hasn't been set. And when the data is posted and processed, it will display the new string. This is pretty much how more complex and sophisticated frameworks, like ASP.NET, Java-Struts, and PHP handle dynamically generated pages. What Francois was offering was a more modern and popular approach, usually called
Re: [twsocket] Post command...
zayin wrote: I do not know enough about all the HTML codes to know if I am missing some. Like refresh current page or reload or simple acknowledge do nothing. There are no such responses. The response codes are typically status codes as a result of the request (error, success, file-not-found, file-found-somewhere-else, etc.). In your case, a successful processing should reply with 200, which means success. However, this is only the response header, you still need the body. If you leave it blank, the browser will just display a blank page, which is even worse. It appears that the only solution is to just retransmit the complete page after the button is pressed. This is the quick solution. Since the protocol is stateless, there is really no way to say Success, now reload the page -- the browser needs to *give* the client the page to reload it. The alternative is to do it in JavaScript, which may be more difficult. -dZ. -- 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] Simple TWSocket listener question
Hello: I'm still getting familiar with the low level functionality of the TWSocket underlying component, so please excuse my question if it sounds trivial. I'm trying to set up a simple tcp listener that accepts a single client connection and communicates with it. I am basing it off the TWSchat demo as it does pretty much what I need: - to accept a client - to keep listening while connected - to respond with a message when other clients connect The way I'm doing it (as per the demo) is to give the accepted socket handle to the client object if it is free in the OnSessionAvailable event: Procedure TSrvApp.Srv_ClientAvailable(Sender: TObject; Error: Word); Begin If (FCliSocket.State = wsConnected) Then Begin // we're busy, dismiss the connection FBusySocket.HSocket := FSrvSocket.Accept; FBusySocket.SendStr('Server busy, try again later.'+ #13#10); FBusySocket.CloseDelayed; End Else Begin // Accept the connection FCliSocket.HSocket := FSrvSocket.Accept; FCliSocket.LineMode := True; End; End; I've noticed that when this is done, the OnSessionConnected event of the client is never triggered. I thought this was unusual as I thought that FD_CONNECT (which ultimately triggers the event) comes after FD_ACCEPT. Or am I doing something wrong? -dZ. -- 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] TWSocketServer and backlog
No worries! Here's the update on this: I have *slightly* modified my application based on the suggestions and insight I received from this list. When I say slightly I mean a lot, but that sounds too ominous :) First, I switched to TWSocketThrdServer without a hitch (hurray! for Arno's hard work on it). This introduced a new bottleneck: the database calls needed to be synchronized, and so it was basically the same as running on a single thread but with the additional overhead of thread creation and synchronization. The end result was that it made my server slower. Which brings me to the second change I made: I re-factored all database requests into a separate thread and completely de-coupled the other two working threads from having to perform any database access or additional management logic; they just post messages to the new thread with the data they need stored in the database. This introduce a whole new level of complexity: that of inter-thread communications and how to cope with un-received posted messages if the thread needs to abort unexpectedly (since the other threads now send and forget and expect the database thread to do its thing). And this led me to the final change in my application: The new database thread became the overall manager of the application: it governs all other threads, instructs them when to start and stop, and appropriately deals with anybody's impromptu demise. So now I have 3 worker threads: 1. Queue Manager: performs all database access, inter-thread management, application initialization and recovery, and overall management of the entire queue. 2. Queue Receiver: accepts incoming client connections and stores their data into the queue, then post the necessary information to the Manager, making sure state is always recoverable in case of failure. 3. Queue Dispatcher: scans periodically the queue and sends the messages via SMTP, then posts a message to the Manager announcing their result (whether success or failure) so that it can update the database record and remove the message from the queue. It also receives notifications from the Manager whenever new messages arrive of higher priority, so that it can interrupt its current scan and address those. Overall, the new design is more elegant and flexible, and still very stable; but more importantly, it is now considerably faster than before (orders of magnitude), and none of the connection issues that I was encountering are manifesting anymore. For the sake of comparisson, it now can take about 30 to 40 seconds to send 1000 messages to the Queue Server. And that's with a backlog of 50. A backlog of 5 takes a few seconds more because (at most) a handful of connections need to be retried (10061 error). A backlog of 10 succeeds without retries and takes roughly the same time. This means that it was my application design which was impeding the performance of TWSocketServer, and not an inherent issue with TWSocket itself (DOH!). System resources are limited, of course, so in my opinion our empirical analysis on the usage of the backlog is still valid: a larger number seems to affect performance negatively without any overall gain in availability, especially under heavy stress. In conclusion, as Arno and Wilfried suggested from the beginning (and as Francois has always claimed), TWSocket is fast, efficient and fully capable of handling thousands of concurrent connections, provided there are sufficient resources for it, and that no _extensive_processing_ is competing with the socket communication. How's that for an endorsement :) Thanks to all of you who offered help and suggestions. Cheers! -dZ. --- Original Message --- From: Hoby Smith[mailto:[EMAIL PROTECTED] Sent: 12/5/2007 12:44:57 PM To : twsocket@elists.org Cc : Subject : RE: Re: [twsocket] TWSocketServer and backlog Hey DZ. Sorry, I didn't mean to drop out of this email thread. I have just been slammed for the last week and didn't have a chance to response to any of the further posts on this (they were buried in very long inbox). From what I see, Wilfried and Arno helped you out more than I would have anyway. Also, sorry I misunderstood your initial post about this. Story of my life... always coming in to the middle of a conversation confused and broke... ;) BTW, the pocket calculator comment was LOL... :) -- 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] ICS
Farhan, I'm posting a copy of this message to the list because I think other members can offer good help for you to migrate your application to ICS. The TWSocket component communicates with the WinSock API at the lowest levels, and therefore it may seem more complicated to deal with than other more abstracted components. However, this is precisely the reason it is so powerful, flexible and efficient. If I understand your question correctly, you want to send a stream of data of arbitrary length, or at least be able to send a large string without having to worry about buffer size or re-building the packets on the receiving end. You can do this quite easily by enabling LineMode and setting a very large number as the maximum line length (ideally, the maximum that your data can be). What this will do is make TWSocket receive all data packets and build the original string completely before triggering the OnDataAvailable event. Therefore, when the event is finally triggered, you are guaranteed to have the entire data. The only other thing you need to select an appropriate delimiter string or character that will let TWSocket know when end of the data has been received. Typically, for the higher-level Internet protocols (such as FTP, SMTP, POP3, etc), a combination of Carriage-Return and Line-Feed (#13#10) serves as the line delimiter. But for binary transfers, you may want to pick something that you can be sure to *not* exist in your data stream. It can be a single control character or a combination, as long as you can be sure it will not occur on your data. So, you set LineMode to true, LineLimit to a very high value (or the length of the data itself), and LineEnd as the end-of-data delimiter, then call SendLine() with the string you want to send: StrData := 'This is the data you want to send'; StrEnd:= #0#0; WSocket.LineMode := True; WSocket.LineLimit := 6553; // Length(StrData) + Length(StrEnd); WSocket.SendLine(StrData); Let me know if you need any more help with this. -dZ. --- Original Message --- From: Farhan Anwar[mailto:[EMAIL PROTECTED] Sent: 12/5/2007 1:23:23 PM To : [EMAIL PROTECTED] Cc : Subject : RE: ICS FARHAN ANWAR Yes Sir i have a question That will help me to convert The Project.If u can Answer then here is my question. In TSockets We can Send As Many data as we can In One line of Code.But In TWSocket We hae to Set the Buf Size,and at the receiving side we get te data in Small packets,or some thing like that.How can i assume that the data i got is the Continued Data sequence and what is the length of the actual data,or simply how can we send and receiove stream -- 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] AV in TWSocketThrdServer.PutDataInSendBuffer
Hello: I was testing my application and and noticed in the log that when I tried to destroy the TWSocketThrdServer while it had opened connections, I got a few (seemingly) random AVs which I traced to the following lines in PutDataInSendBuffer method: procedure TCustomWSocket.PutDataInSendBuffer(Data : Pointer; Len : Integer); var oBuffer : TBuffer; cWritten : Integer; bMore : Boolean; begin if (Len = 0) or (Data = nil) then exit; {$IFDEF COMPILER2_UP} EnterCriticalSection(GSendBufCritSect); try {$ENDIF} { THE FOLLOWING LINE } if FBufList.Count = 0 then begin oBuffer := TBuffer.Create(FBufSize); FBufList.Add(oBuffer); end else oBuffer := FBufList.Last; Inc(FBufferedByteCount, Len); bMore := TRUE; while bMore do begin cWritten := oBuffer.Write(Data, Len); if cWritten = Len then bMore := FALSE else begin Len := Len - cWritten; Data := PChar(Data) + cWritten; if Len 0 then bMore := FALSE else begin oBuffer := TBuffer.Create(FBufSize); FBufList.Add(oBuffer); end; end; end; bAllSent := FALSE; {$IFDEF COMPILER2_UP} finally LeaveCriticalSection(GSendBufCritSect); end; {$ENDIF} end; The full error is [EAccessViolation] Access violation at address 00469094 in module 'SmailQ_con.exe'. Read of address 0008 Its hard for me to reproduce exactly, but has anybody any idea what could be causing this? -dZ. -- 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] Webserver only with local connections
George, I think Hoby's response is excellent, but I wanted to add a few suggestions based on my interpretation of your problem. 1. If the source address of each of the hosts that will communicate is known, then you can check for this using the GetPeerAddr method from within the SessionAvailable method of TWSocket (I believe this is exposed in HttpCli as the OnClientConnect event), and as Hoby suggested, abort the connection if the address does not match. Obviously, this will bind your application to those specific addresses, so if they ever changed you'll need to make sure to update the validation values. Also, as Hoby mentioned, you must bear in mind that the source IP address can be spoofed, so depending on the criticality or exposure of your application, you may not want to trust it. 2. Authenticate the incoming request by using one of the common mechanisms supported by HttpCli. This still means that the connection needs to be accepted, and actively rejected if it failed authentication. One last note: Under no circumstances trust any information available on the HTTP request/response header for validation or authenticity (IP address, referrer, content-type, etc.); these are very trivial to forge. For most HTTP appliations, this is normally not a problem, as long as they do not expect any of those values to contain critical information that could affect the behaviour of the system. -dZ. -- DZ-Jay [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html --- Original Message --- From: Hoby Smith[mailto:[EMAIL PROTECTED] Sent: 12/4/2007 12:05:56 PM To : twsocket@elists.org Cc : Subject : RE: Re: [twsocket] Webserver only with local connections George... Fundamentally, there are really only two ways to constrain inbound connections regarding client identification. As I am sure you are aware, keep in mind that neither TCP nor HTTP have any built in mechanisms for facilitating client identification or rejecting connections based on any rules. As a result, it is irrelevant what address / port you listen on, as TCP will always attempt to allow the connection initially, unless a firewall or something else between the host and server prevents the process. It is up to you then to reject any unwanted connect attempts at some point. Given this, you must address the issue in either or both of the following areas: 1. Client origin or source of connection If you wish, you may determine the client's origin and reject the connection based on that origin. The TWSocket components give you this ability at the session level. The standard TCP stack has no mechanism to do this until after the session is actually arbitrated, so by default you must accept the connect (at least partially into the cycle), then reject the connection, once you have determined that you wish to do so. So, if you wanted to constrain the source address of the client to a local or specific address only, you could provide some functionality in the OnClientConnect event that determines the connecting source address and rejects the ones you don't want, such as if it is not in the local address space. Bear in mind that the local address space could originate from the local loopback (127.0.0.1), as well as one of the local NIC addresses as well. For example, you could use, TMyHttpConnection(Client).GetPeerAddr, to get the client's address and then determine if you want to disconnect it. You would have to provide this logic and any rules as you need. Also, bear in mind that the source address can be compromised through various attacks. PPTP and other forms of tunneling attempt to prevent those kinds of issues (such as with VPNs implementations). 2. Some form of secure authentication that should be at least moderately trustable. If I understand your need correctly, you are saying that you DO want to allow connections from other IP subnets, you just want to know if they are from you or something else. To accomplish this, you need to support some form of authentication, because there is NO inherent ability in TCP or HTTP to tell you this. This is what you are really looking for. Regardless of the source of origin, you are really trying to ask the question, Is this me or someone else? Right? If so, the only solution is to use some form of authentication to determine this. I personally don't use HTTP much because it is so weak in this regard; in that, it has no native ability to support authentication. As a result, you must address authentication very high up the stack, on top of protocols that understand nothing about security or authentication. However, there are several mechanisms for performing authentication over HTTP. I would suggest that you look at the ICS demo app WebServ. It appears to be handling the authentication you are looking for and should have the code examples you are looking for. Then, after you successfully authenticate the client, the next challenge comes
Re: [twsocket] TWSocket transliterating tabs to spaces (nevermind)
Hello: Nevermind my last message. Like an idiot, I set LineEdit mode to True by mistake. I made this change inadvertently today, which explains why I didn't notice it before. Sorry, -dZ. --- Original Message --- From: [EMAIL PROTECTED]:[EMAIL PROTECTED] Sent: 12/3/2007 4:09:17 PM To : twsocket@elists.org Cc : Subject : RE: [twsocket] TWSocket transliterating tabs to spaces (?!) Hello: I just noticed something very bizarre: My client application sends text data using TWSocket to a TWSocketServer server application, and leading tabs are transliterated into spaces when they arrive! I've traced a particular string all the way until TWSocket puts it in its internal buffer to send and it still contains a #09 char at byte position 0. However, tracing the OnDataAvailable event of the receiving TWSocketClient, ReceiveStr returns the same string but now it has spaces at the beginning and no tab character. I don't recall ever seeing this before. Perhaps I'm missing an obscure setting or made a stupid mistake? Can anybody offer any suggestions? -dZ. -- 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
[twsocket] TWSocket transliterating tabs to spaces (?!)
Hello: I just noticed something very bizarre: My client application sends text data using TWSocket to a TWSocketServer server application, and leading tabs are transliterated into spaces when they arrive! I've traced a particular string all the way until TWSocket puts it in its internal buffer to send and it still contains a #09 char at byte position 0. However, tracing the OnDataAvailable event of the receiving TWSocketClient, ReceiveStr returns the same string but now it has spaces at the beginning and no tab character. I don't recall ever seeing this before. Perhaps I'm missing an obscure setting or made a stupid mistake? Can anybody offer any suggestions? -dZ. -- 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] TWSocket transliterating tabs to spaces (?!)
Thank you for your very fast response -- even faster than my other message acknowledging my stupidity :) Is LineEdit turned on ? Yes, it was. DOH! Thanks, -dZ. -- 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] TWSocket transliterating tabs to spaces (nevermind)
I noticed that it is not initialized anywhere, which means that its going to be False by default (supposedly). Perhaps compiler optimizations will cause it to be stored in a cpu register and without initialization may not be guaranteed to be 0 (false). -dZ. --- Original Message --- From: Arno Garrels[mailto:[EMAIL PROTECTED] Sent: 12/3/2007 4:38:28 PM To : twsocket@elists.org Cc : Subject : RE: Re: [twsocket] TWSocket transliterating tabs to spaces (nevermind) [EMAIL PROTECTED] wrote: Hello: Nevermind my last message. Too late ;-) But it should be realy made the default value. FLineEdit seems not being initialized correctly allways, at least not by the Delphi 7 compiler, maybe when Optimization is turned off ? -- Arno Garrels Like an idiot, I set LineEdit mode to True by mistake. I made this change inadvertently today, which explains why I didn't notice it before. Sorry, -dZ. --- Original Message --- From: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] Sent: 12/3/2007 4:09:17 PM To : twsocket@elists.org Cc : Subject : RE: [twsocket] TWSocket transliterating tabs to spaces (?!) Hello: I just noticed something very bizarre: My client application sends text data using TWSocket to a TWSocketServer server application, and leading tabs are transliterated into spaces when they arrive! I've traced a particular string all the way until TWSocket puts it in its internal buffer to send and it still contains a #09 char at byte position 0. However, tracing the OnDataAvailable event of the receiving TWSocketClient, ReceiveStr returns the same string but now it has spaces at the beginning and no tab character. I don't recall ever seeing this before. Perhaps I'm missing an obscure setting or made a stupid mistake? Can anybody offer any suggestions? -dZ. -- 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] ICS wiki templates (are there any?)
Hello: I noticed that a lot of the components and their methods/properties wiki pages have basically the same layout and sections, and I was wondering (before I endeavor to start from scratch) if there was a template, or if it's just copy+paste from a previous one? -dZ. -- 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] TWSocketServer and backlog
--- Original Message --- From: Arno Garrels[mailto:[EMAIL PROTECTED] You can exchange data between threads the most easy is by posting a message where a pointer to the data is in WParam argument. The pointer can be freed in the custom message handler. That's indeed the fastest way since the thread must not wait. However, if the main thread notified the slave threads to quit, the last thread that quits may post messages (before receiving the WM_QUIT message) to the first one and fail, which will cause the memory in the message to not be freed (until the application finally quits). I don't know if this is a real concern, though. 1 - Stressing a server with 100 connection attempts per second is most likely not a real world scenario, except upon DoS attacks. I agree. However, this is very easily done by a brain-dead developer using my queue client class in a simple 'for' loop to send a lot of messages at once, say, an announcement to all our customers. I would like to prevent this as much as possible by improving connection acceptance speed on the server, or else I'll have to cripple the client somehow. Do not underestimate the tenacity of morons. :) 2 - Run your stress tester against IIS or other servers, I found that they were not able to accept more clients per second than my server. I'm sure this is true. I am able to avoid the whole issue by responsibly designing the client application: send the next connection request after the first one triggers OnSessionConnected, or connecting only a few clients at a time, then pause until they are done. This not only improves performance of the server, but it prevents an inadvertent DoS attack from an application that needs to send lots of messages at once. 3 - I played with different designs. Which would you consider to work best? The goal is to accept clients as fast as possible, once they are connected it won't hurt to let them wait some milliseconds. This is indeed my goal. Would it make sense to have a pool of listening sockets in a separate (single) thread that will post a message to the (single) working thread with the socket handle? That way the connections can be established quickly, and my server can continue doing its processing within a single thread so that I don't have to redesign it right now. -dZ. Sent: 11/29/2007 1:52:38 PM To : twsocket@elists.org Cc : Subject : RE: Re: [twsocket] TWSocketServer and backlog DZ-Jay wrote: On Nov 29, 2007, at 06:10, Wilfried Mestdagh wrote: Hello DZ-Jay, So conclusion is that increasing the backlog does: - decrease the performance for accepting connections - decrease the overall performance of the application This seems to be the conclusion of mine and Huby's tests. Strange, I never noticed something like that. Perhaps I should run the TWSocketServer on its own thread, and post messages from the clients to the queue manager thread to do the work? Although this seems too complex and expensive. It almost looks like each client should run on its own thread... :( I'm that sure: 1 - Stressing a server with 100 connection attempts per second is most likely not a real world scenario, except upon DoS attacks. 2 - Run your stress tester against IIS or other servers, I found that they were not able to accept more clients per second than my server. 3 - I played with different designs. a) Listening sockets in one thread, client sockets in another thread(s). This introduces a new problem, clients are accepted very fast, however the listening thread must synchronize with the client thread(s) which may take longer than with current TWSocketServer, I worked around by posting just the socket handle to the thread which was fast, however also rather complicated to handle all the client stuff/pool in the threads. b) Listening sockets in one thread, one thread per client. AFAIR without a thread pool accepting clients was slower than with TWSocketServer. c) I even hacked together a server that used M$ overlapped sockets, this was a rather disapointing discourse since performance was the same as with (a). The goal is to accept clients as fast as possible, once they are connected it won't hurt to let them wait some milliseconds. Before you rewrite your application I suggest you code some test apps. with different designs and compare their performance. -- Arno Garrels dZ. -- DZ-Jay [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 -- 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] I need some help understanding TWsocket states
Hello: This may sound stupid, but could you verify that the OnSessionAvailable event is actually wired (assigned to the property)? It seems strange that it is not called, yet OnDataSent is. Also, what happens when you try to send a second time (or does it even try)? Do you get a Component already connected error or something like that? If your burst messages are short as your example implies, then there is really no reason to do this on a separate thread; it will actually be slower to spawn a new thread and execute it than to just re-connect and call SendStr. -dZ. --- Original Message --- From: Pete Williams[mailto:[EMAIL PROTECTED] Sent: 11/28/2007 1:49:27 PM To : twsocket@elists.org Cc : Subject : RE: Re: [twsocket] I need some help understanding TWsocket states Thank you to the two people who replied. I got really good advice which I followed and this seems to have given me a working server, but I still have client problems. - I created a message-pump in a distinct thread for the DLL server, as advised. - Both client and server were changed to async programming style, and this worked for the server. I have another problem though, which seems stange, and may be related to timing (or something). My client wants to sometimes connect to the server, send a few lines of data, and then disconnect. When I want to send data this is what I do procedure sendData(asMessage: string); begin mystringlist.add(asMessage); if mytwsocket.state wsConnected then begin mytwsocket.addr := '127.0.0.1'; // client and server are on same machine mytwsocket.port := '17072'; mytwsocket.connect(); end; end; Then I have handlers for OnSessionAvailable and OnDataSent. OnSessionAvailable doesn't seem to get called ever. In OnDataSent I do this begin if mystringlist.count 0 then begin mytwsocket.sendStr(mystringlist[0]+#$D#$A); mystringlist.delete(0); // we've sent this one end else begin mytwsocket.close(); // no more data to send, so close end; end; Here's what I've observed. The client can send once, and that's it. I can't send twice. However, if I put a breakpoint at the end of the function that connects to the server,it works - almost like there is some kind of timing issue. I'm working on Windows 2003. Should I use threads for my clients as well? Any advice is greatly received. Wilfried Mestdagh wrote: Hello Pete, if myclient.state wsConnected then begin myclient.connect; loop for 5 seconds begin You have to think async. TWSocket uses events. think on events as a OnClick event of a butten. You don't write loops to wait until a user click a button. So you have to change to: MyClient.Connect; // that's all and in the OnSessionAvailable event you start do TWSocket(Sender).sendstr(thedatastring); myclient.processMessages; General a very bad idea to call the message pump yourself. myclient.close(); If your client has send all the data then you still dont know if the other end has received an handled the data. if you design your proto yourself then the receiver can close. if you dont then call ShutDown(1); myserver.OnsessionAvailable begin myserversocket.dup(myserversocket.accept()); end; Better to use TWSocketSer4ver. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Monday, November 26, 2007, 18:58, Pete Williams wrote: Hello again I'm trying to write a very simple client/server socket application using TWSocket. However, I think I may not understand the use of states correctly. What I want is for the client to connect to the server, send some data, and then disconnect. If it has more data to send, I want it to connect again and repeat the process. Here's what is happening at the moment. The client can connect to the server and successfully send as much data as it chooses. However, once it disconnects it can't reconnect. The code on the client is broadly thus (using a pseudo code): if myclient.state wsConnected then begin myclient.connect; loop for 5 seconds begin myclient.processMessages; if myclient.state = wsConnected then begin lbConnected := TRUE: break; end; end loop; end else lbConnected := TRUE; if lbConnected then myclient.sendstr(thedatastring); myclient.close(); On the server, this is what I have: myserver.OnsessionAvailable begin myserversocket.dup(myserversocket.accept()); end; I'm also handling the OnDataAvailable event, and this works fine - but only the first time (or at least until the client disconnects). I've tried recalling listen() in the OnSessionClosed event
Re: [twsocket] TWSocketServer and backlog
--- Original Message --- From: Paul[mailto:[EMAIL PROTECTED] I always use 500, no problems yet Thanks for the quick reply. Then, is there a particular reason why it defaults to 5? It seems too low for all but the most trivial applications (given that spawning the client object and dupping the socket seems to take a relatively long time). -dZ. -- 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] I need some help understanding TWsocket states
Hello: OnSessionAvailable is triggered when an incoming connection is about to be established, as soon as the request is received, but before the socket is properly opened. OnSessionConnected is triggered right after the connection, either incoming or outgoing, is properly established and state is changed to wsConnected. If you're not listening on the port, then that could explain why OnSessioinAvailable is not being triggered. You want to handle OnSessionConnected instead. -dZ. --- Original Message --- From: Pete Williams[mailto:[EMAIL PROTECTED] Sent: 11/28/2007 2:09:51 PM To : twsocket@elists.org Cc : Subject : RE: Re: [twsocket] I need some help understanding TWsocket states I don't mind checking simple stuff. I'm desperate, as I have a deadline for Saturday! It is definately connected hooked-up. Nothing is over-writing it. [EMAIL PROTECTED] wrote: Hello: This may sound stupid, but could you verify that the OnSessionAvailable event is actually wired (assigned to the property)? It seems strange that it is not called, yet OnDataSent is. Also, what happens when you try to send a second time (or does it even try)? Do you get a Component already connected error or something like that? If your burst messages are short as your example implies, then there is really no reason to do this on a separate thread; it will actually be slower to spawn a new thread and execute it than to just re-connect and call SendStr. -dZ. -- 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] TWSocketServer and backlog
Hello: The problem with retrying is that it is not the same as a server full error when the maximum number of clients is reached; 100061 is essentially a port not open error, which is the same error you would get if the server is not running. So there is no real way to know that the listener is currently busy and the backlog full, or if the server is listening on a different port or disabled completely. I will certainly increase the backlog on my server, but will also consider building a number of retries in the connection routine of the client class. Thanks for the help. -dZ. --- Original Message --- From: Wilfried Mestdagh[mailto:[EMAIL PROTECTED] Sent: 11/28/2007 2:26:49 PM To : twsocket@elists.org Cc : Subject : RE: Re: [twsocket] TWSocketServer and backlog Hello dz, a client application should do at least a few (or infinity) retry's if connection fails. so normally not needed to increase it. On the other hand it does no harm to increase it. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Wednesday, November 28, 2007, 18:27, [EMAIL PROTECTED] wrote: Hello: While stress-testing my application, I noticed that I am able to send substantially many more connections in the time it takes the TWSocketServer to handle the incomming requests, causing the default backlog to fill up quickly. Obviously, I can increase the number, but seeing that the default is 5 (which seems rather low to me), I'm thinking that perhaps there may be a concern in setting this too high. Does anybody know what I should take into consideration before changing this value, and if there are any concerns with it being too high? Thanks, -dZ. -- 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] I need some help understanding TWsocket states
Pablo, Are you having more problems? P.S. Puedes comunicarte conmigo directamente si necesitas ayuda en español. Translation: You can contact me directly if you require help in Spanish. -dZ. --- Original Message --- From: Pablo Harguindey[mailto:[EMAIL PROTECTED] Sent: 11/28/2007 3:22:18 PM To : twsocket@elists.org Cc : Subject : RE: Re: [twsocket] I need some help understanding TWsocket states *help -- 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] ASyncReceive and wsoNoReceiveLoop
Hello: I'm not sure if this is related to your problem, but I had a similar incident in the past, and it turned out to be an unchecked buffer in my OnDataAvailable event handler which caused an overflow, which led to the TWSocket component not realizing that the buffer had been emptied and triggering the event again. Check to make sure that you are not overwriting some data in your event handler due to a buffer overflow. -dZ. --- Original Message --- From: Jake Traynham[mailto:[EMAIL PROTECTED] Sent: 11/28/2007 4:24:15 PM To : twsocket@elists.org Cc : Subject : RE: [twsocket] ASyncReceive and wsoNoReceiveLoop Hello all, I'm using ICS version 6.06 with Turbo C++ Explorer 2006. I had been fighting a problem where my DataAvailable event was being called twice as many times (minus 1) as actually needed. Since I've been using the ICS components for many, many years now, I obviously started looking to see if somehow I was calling ProcessMessages again within the DataAvailable. I couldn't find any where that was true. I finally looked into the TWSocket sources to see where DataAvailable was triggered from and to see if anything there would make it act this way. This is when I saw this wsoNoReceiveLoop thing (which is apparently off by default). Turning that option on made my problem go away. My question is, what am I missing? Either I don't understand why you would *want* ASyncReceive to loop, or maybe I'm not correctly reading in the data? The component I'm working on receives large amounts of data from a server in successive blocks. From what I observed, my DataAvailable event was being called twice minus one more times than it needed to be. For example, if the server sent 6 blocks of data, my DataAvailable event would get called 6 times to receive all of the data, then get called 5 more times. In the 5 extra times, my code would attempt to do a Receive, which would return -1 along with the Would Block winsock error. So, it seems that for every time ASyncReceive looped, there would still be a message (FD_Read??) being put in the queue to call it again, which would call my DataAvailable event again, but there wouldn't be any data to read because ASyncReceive had already looped to get all the data. Again, am I missing something here? Should there have only been one FD_Read in the queue initially which would start the ASyncReceive loop but some how the queue is getting corrupted (by some call to ProcessMessages maybe) causing it to respond to the FD_Read more than once. Or should there be an FD_Read for every block of data coming from the server, and if that's the case, why does ASyncReceive loop? Because if there is an FD_Read for every block of data, then ASyncReceive and any DataAvailable events would be called multiple times. Help! :) Jake -- Jake Traynham Owner, CNS Plug-ins http://www.cnsplug-ins.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] TWSocketServer and backlog
Hello: Thank you for your very informative response. I was performing some tests on my server application by continually increasing the backlog value with some mixed results, which seem to coincide with your empirical analysis. I kept increasing the backlog value up until I reached 1000, but to my surprise, I noticed that the connections started failing after about 230 requests, out of 1000 clients. These were the first 230 requests, so the backlog queue was significantly less than its maximum. I also thought I noticed that the server was taking longer to respond, but didn't think much of it at the time. However, after reading your post I decided to try once again with a backlog of 5, and set a retry loop every time a connection failed. As expected, the connections started failing almost immediately after the test started. But much to my surprise, the connections were handled quicker -- sometimes orders of magnitude faster than before! As a reference, using my localhost as the server and client, with a test application spawning 1000 clients to connect one right after the other, and re-trying if they failed, it took about 5 to 7 minutes to process the entire lot; while it only took about 2 minutes to process with a backlog of 5. The test with a backlog limit of 5 retried much more times, of course, but when connections were established, they were processed faster. Still, it seems to me that TWSocketServer is taking too long to process incoming connections, as many connections can be queued in the backlog while its instantiating the client and dupping the socket. Any thoughts on this? -dZ. --- Original Message --- From: Hoby Smith[mailto:[EMAIL PROTECTED] Sent: 11/28/2007 5:31:09 PM To : twsocket@elists.org Cc : Subject : RE: Re: [twsocket] TWSocketServer and backlog FYI... I ran into an issue with some test code I wrote a few months ago, which related to the backlog setting, as well as the annoying issue with Winsock running out of local ports. In my test, I was attempting to see how many connections could be handled by a particular process over a period of time. I believe my results showed that increasing this value can have a very negative effect on performance. Basically, the issue is inherent in how the TCP stack is implemented, not in how a particular app services the stack. I found that surpassing a particular connection rate threshold would result in an exponential gain in processing time on the listening stack. Meaning, the TCP stack performance decreases dramatically as you increase the number of pending connections, when the listening socket is receiving a high rate of connection requests. My assumption is that this is due to the increased overhead in managing the backlog queue. Given this, I made two observations, which may be wrong, but made sense to me. First, this is why the Winsock default is 5. I imagine that the Winsock stack implementation was designed with the perspective that if the backlog is actually filling up enough to reach 5 or more, then something is wrong. Probably, a couple more might be ok, but my results showed that as you increased this value under heavy load, your connection rate was very unpredictable, as well as instable (lots of failed connects). For the TCP/IP stack to be effective, it must be responsive enough to handle the low level connection requests in a timely fashion. If not, then you have a major low level servicing problem or the machine is seriously overloaded with TCP requests. In which case, you want to get connection errors, rather than an overloaded backlog scenario. Second, increasing this value surely creates a greater DOS attack surface, making you more vulnerable to bursts of socket open requests, and surely would make the effects of such an attack even worse. This might also be why the Winsock default is 5. However, as I personally don't think that there is really a practical solution to a well designed DOS attack, then this might not really be relevant. Nonetheless, it might be something you need to consider. So, given that, I personally don't recommend increasing the value. If your app can't service the stack with a backlog setting close to 5, then your system is just overloaded or not responsive for some reason. Anyway, that is what I determined from my testing results. If anyone has found to the contrary, please feel free to correct me... :) -Original Message- -- 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] http://www.overbyte.be/
I get the following message: Maintenance mode Cette machine windows 2000 vient d'etre victime d'une mise a jour microsoft corrompue la reinstallation des backups ne résout rien nous avons mis ce serveur apache provisoire pour vous informer de l'évolution nous réinstallons les sites un à un il est probable que tout ce qui est composants Micro$oft : ftp, odbc, access, asp ne marchera pas avant une longue huit de réinstallation La page que vous voyez pour l'instant est peut etre ancienne, n'oubliez pas de rafraichir et faire F5 dans votre navigateur pour voir les nouveaux contenus -dZ. --- Original Message --- From: Angus Robertson - Magenta Systems Ltd[mailto:[EMAIL PROTECTED] Sent: 11/15/2007 1:08:43 PM To : twsocket@elists.org Cc : Subject : RE: [twsocket] http://www.overbyte.be/ The web site has not been responding this afternoon, and now shows a page about 'Dalis SCRL'. 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
[twsocket] TWSocketServer Client.Shutdown(1) does not destroy it
Hello: I just started noticing this behaviour today, and I seem to recall it working differently: When handling the OnClientDataAvailable event, if I determine that the client needs to be disconnected, I call (Sender As TMyClient).Shutdown(1). The connection is dropped fine, but the client object is never freed until the server shuts down completely. Here's a sample of my code: Procedure TMyServer.ClientDataAvailable(Sender: TObject; Error: Word); Begin With (Sender As TMyClient) Do Begin If (SomethingBadHappened) Then Begin SendLine('Error!'); Shutdown(1); End; End; End; I call Shutdown(1) so that the connection is dropped gracefully and the error response is received by the client. I don't recall changing this recently, so I'm confused as to why it would have been destroying the client before and not now (I may have changed some of the default properties, though I don't recall anything pertinent to this issue). Perhaps there's an even better way? Thanks for the help, -dZ. -- 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
Re: [twsocket] TWSocketServer Client.Shutdown(1) does not destroy it
I believe I solved it: It turns out that my application was intercepting the WM_CLIENT_CLOSED message mistakenly. My application use TWSocketServer within a worker thread, and this worker thread has a custom message dispatcher so that it can process messages sent to the thread without a hidden window. The problem was that I forgot to check if the Msg.HWND property was 0 before calling the custom dispatcher. Since I solved my own problem, and it has nothing to do with TWSocket, this message is not Off Topic. -dZ. --- Original Message --- From: [EMAIL PROTECTED]:[EMAIL PROTECTED] Sent: 10/17/2007 2:36:00 PM To : twsocket@elists.org Cc : Subject : RE: Re: [twsocket] TWSocketServer Client.Shutdown(1) does not destroy it Hello: Its worse... I also noticed that TWSocketClient.TriggerSessionClosed() is triggered by the client, but the message posted is never received by the server. This happens even then the client drops the connection. So, for some reason, the clients are never destroyed. I'm sure that its something to do with my code, but can anybody offer some suggestions as to what may cause this behaviour? Thanks, -dZ. --- Original Message --- From: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] Sent: 10/17/2007 2:06:48 PM To : twsocket@elists.org Cc : Subject : RE: [twsocket] TWSocketServer Client.Shutdown(1) does not destroy it Hello: I just started noticing this behaviour today, and I seem to recall it working differently: When handling the OnClientDataAvailable event, if I determine that the client needs to be disconnected, I call (Sender As TMyClient).Shutdown(1). The connection is dropped fine, but the client object is never freed until the server shuts down completely. Here's a sample of my code: Procedure TMyServer.ClientDataAvailable(Sender: TObject; Error: Word); Begin With (Sender As TMyClient) Do Begin If (SomethingBadHappened) Then Begin SendLine('Error!'); Shutdown(1); End; End; End; I call Shutdown(1) so that the connection is dropped gracefully and the error response is received by the client. I don't recall changing this recently, so I'm confused as to why it would have been destroying the client before and not now (I may have changed some of the default properties, though I don't recall anything pertinent to this issue). Perhaps there's an even better way? Thanks for the help, -dZ. -- 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
Re: [twsocket] TWSocketThrdServer
QUOTE: Anne What difference is between to use TWSocketThrdServer and use TWSocketServer with ClientThread? Which is better for me? END. TWSocketThrdServer spawns a new thread for each incoming client (or a new thread after the maximum amount of clients per threads has been reached). TWSocketServer handles all clients within the same thread in an asynchroneous, event-driven way. Both handle multiple clients at the same time, the difference is the thread model. If you use the multi-threaded version, keep in mind that development and debugging is substantially more complex because of thread-safety and synchronization issues. Also, keep in mind that spawning new threads is a resource-expensive process. Because of this, it is always recommended that you use the single-threaded approach unless you *absolutely need* to use multiple threads. As I have discovered recently on this list while discussing this topic, if you are not sure that you *absolutely need* to use multiple threads, then chances are you don't. TWSocketServer is able to handle many hundreds of concurrent clients in an efficient way, and its optimized for high-performance. However, if your clients have to do very intense or long processing with the data, this may prevent the other clients from processing data, so you may need to look into the multi-threaded approach. -dZ. -- 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
Re: [twsocket] Over TWSocketServe
Very thanks. I will see this. I'm sorry, I gave the wrong demo names. The multi-threaded example applications are ThrdSrv, ThrdSrvV2, and ThrdSrvV3 (the last one using TWSocketThrdServer). The single-threaded one is TcpSrv. They are in the Internet directory in the ICS distribution. -dZ. -- 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
Re: [twsocket] TWSocketThrdServer friendly notice whendisconnecting.
--- QUOTE: SZ If you do not want the ability to use multi-cores for communication threads, then async is the way to go. But IMO, it is an ill design since chipmakers are talking about 64-core CPUs and 10Gbps networks. --- END. Thanks, SZ. At this point I'm not so much concerned about complexity (although, of course, that is a concern), but more about performance and efficiency. I know that the arguments are always against multiple threads because they are harder to debug and synchronize, which is a very valid argument, and one that's biting me in the ass right now, but is that at the cost of a perceivable performance hit? Or is the async component not only simpler to use, but just as fast (or at least not significantly slower)? -dZ. -- 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
Re: [twsocket] Using SourceForge for ICS ?
Currently I don't plan to put ICS-SSL on SourceForge. I also wouldn't recommend it, until that time when you release it as open source (if ever you intend to do so). Still, it wouldn't hurt at all to set up SVN in your local machine to maintain the source :) -dZ. -- 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
Re: [twsocket] ICS on SourceForge, which license is best ?
So far, the closest thing to your PostcardWare License that I have found is this: The Educational Community License http://www.opensource.org/licenses/ecl1.php It grants all the same rights that your license does, and has a provision to prevent confusion between derivative works and the original (i.e. modified versions cannot be claimed to be the original). The only thing missing is the postcard condition :) -dZ. --- Original Message --- From: Francois PIETTE[mailto:[EMAIL PROTECTED] Sent: 10/8/2007 2:59:47 PM To : twsocket@elists.org Cc : Subject : RE: [twsocket] ICS on SourceForge, which license is best ? I would like to have your opinion about which license I should select at SourceForge ( http://www.opensource.org/licenses/category ). I have not much time to read all possible licenses. You all know the current license displayed in each source file (see below for reminder). I would like to stay as close as possible to this simple license. Basically, I want to preserve my intellectual property while granting anyone to use and redistribute ICS source code, including in commercial applications and royalty free. Legal issues: Copyright (C) 1996-2007 by François PIETTE Rue de Grady 24, 4053 Embourg, Belgium. Fax: +32-4-365.74.56 [EMAIL PROTECTED] This software is provided 'as-is', without any express or implied warranty. In no event will the author be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented, you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. 4. You must register this software by sending a picture postcard to the author. Use a nice stamp and mention your name, street address, EMail address and any comment you like to say. -- [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://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
Re: [twsocket] Using SourceForge for ICS ?
What are the requirement for such a server ? Not much. 1. Enough disk space to hold the growing repository 2. Connected to the Internet (hopefully with a firewall :) 3. Apache (to allow for web-based repository access, which is easier to maintain) Here's a link with a discussion on the subject: http://subversion.tigris.org/servlets/BrowseList?list=usersby=threadfrom=330941 -dZ. -- 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
Re: [twsocket] ICS on SourceForge, which license is best ?
Indeed it looks very close to my usual license. Any known drawback with this license ? Not that I know of, nor that I can see. It seems very close to the MIT license, except that the MIT license does not provide for the clear distinction of modifications from the original work -- which, in my opinion, is also the main point of your license. Here's a discussion I found on the license when the author was submitting it for approval by the Open Source Initiative: http://www.mail-archive.com/[EMAIL PROTECTED]/msg07630.html A quick Google search appears to show that the license is popular. And as far as I know, it is very common in academic research institutions. I also found version 2.0 of the license, which is based on the Apache license (again, adding the provision for distinction of derivative works). Its basically the same thing but with more legal-speak. I am not a lawyer, so I cannot tell whether any of that verbiage is actually necessary, but it seems to be in many software licenses nowadays, and perhaps that was the intention. However, it seems to mostly protect against patent lawsuits, which I understand would be an issue to a research institution. Educational Community License, Version 2.0 http://www.opensource.org/licenses/ecl2.php -dZ. -- 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
[twsocket] TWSocketThrdServer stuck in destructor loop when killing threads
Hello: I'm having a problem with the TWSocketThrdServer. My application has a worker thread that contains a TWSocketThrdServer member to handle all incoming requests. When the main thread finishes, it sends a WM_QUIT message to the worker thread, which then finishes and frees the TWSocketThrdServer. However, if there are clients connected, the thrdserver stalls in its destructor, while waiting for all its threads to finish. It only loops forever when there are clients connected and the worker thread is terminated. But if there are no clients connected, it works fine. Can someone offer any help? Most likely I'm doing something wrong. (Below is an example of my code.) Also, I need to be able to terminate the entire application if something goes wrong while processing clients. What is the best way to do this? Should I post a message to the main thread from a TWSocketThrdServer event in the worker thread? Thanks! dZ. My code is somewhat like this (this is very much simplified): Interface Type TServerThrd = Class(TThread) Private FSocketSrv: TWSocketThrdServer; Public Constructor Create; Reintroduce; Destructor Destroy; Override; Procedure Execute; Override; End; TQApp = Class(TObject) Private FServerThrd : TServerThrd; Public Constructor Create; Destructor Destroy; Override; End; Implementation { TQApp } Constructor TQApp.Create; Begin FServerThrd := TServerThrd.Create(False); End; Destructor TQApp.Destroy Begin Try Try PostThreadMessage(FServerThrd.ThreadID,WM_QUIT,0,0); Finally FServerThrd.WaitFor; FServerThrd.Free; End; Finally Inherited Destroy; End; End; { TServerThrd } Constructor TServerThrd.Create; Begin Inherited Create(True); End; Destructor TServerThrd.Destroy; Begin Try If Assigned(FSocketSrv) Then Begin FSocketSrv.Free; // -- HERE! (waits forever) End; Finally Inherited Destroy; End; End; Procedure TServerThrd.Execute; Begin Try FSocketSrv := TWSocketThrdServer.Create(Nil); FSocketSrv.Listen(); FSocketSrv.MessageLoop; Finally // do other cleanup End; End; -- 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
Re: [twsocket] Using SourceForge for ICS ?
Yes, and TortoiseSVn looks like a very cool and powerfull tool on the first glance! It is. I don't need nor care about BDS integration anymore; I do all manipulations of the source files through the Explorer shell using TortoiseSVN. It even overlays the folder/file icons with symbols of their status (modified, conflict, updated, etc.). -dZ. -- 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
Re: [twsocket] Using SourceForge for ICS ?
Hello: I've used SourceForge before, and it is a nice environment for distribution and project sharing and participation. I will suggest you use SubVersion (SVN) -- it is a considerably better than CVS. As a matter of fact, it was designed to overcome some of the limitations of CVS. SVN and CVS have different ways of working, so if you are used to using CVS, you'll have to unlearn some concepts and learn some new ones. It may seem confusing at first, but once you understand SubVersion's concepts, everything seems so natural. (even more so than with CVS, which is clunky). Plus, if you use the TortoiseSVN client, it integrates very nicely with the Windows Explorer (and I believe there's a BDS plug-in), so you'll never have to face the dreaded WinCVS GUI ever again. I've worked with SVN for the past few years, so I am willing to offer any assistance you may need. -dZ. --- Original Message --- From: Francois PIETTE[mailto:[EMAIL PROTECTED] Sent: 10/2/2007 12:55:22 PM To : twsocket@elists.org Cc : Subject : RE: [twsocket] Using SourceForge for ICS ? Hello Guys ! I'm considering the option of pushing ICS to SourceForge and I would like to have your opinion. Does someone already have a real experience of SourceForge as a developper ? The first decision is should I select CVS or SVN ? Any advice appreciated. -- [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://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
[twsocket] TWSocketThrdServer - Bogus OnDataAvailable triggered when Closed.
Hello: I'm using TWSocketThrdServer and processing client data from within the OnDataAvailable event handler (client is set to LineMode=True). I've noticed that if the data transaction is completed and I call Client.Close from within this event, the event is called again with the previous ReceivedStr. Here's a sample of the code I am using: Procedure TMyServer.HandleDataAvailable(Sender: TObject; Error: Word); Var DataStr: String; bDone: Boolean; Begin If (Error = 0) Then Begin With (Sender As TMyClient) Do Begin DataStr := ReceiveStr; // parse the DataStr and do // whatever needs to be done. // bDone may be set here. If (bDone) Then Begin SendLine('Sayonara.'); TMyClient(Sender).Close; // -- HERE! End; End; End Else Begin // Handle errors... TMyClient(Sender).Abort; End; End; When that Close method is called, the event is immediately re-entered with the same data. Am I doing something stupid? Thanks, -dZ. -- 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
[twsocket] Cancelling TWSocketServer client connection
Hello: I am performing a series of steps when a new client connection is received (in the OnClientCreate event handler) which may cause the connection to become invalid (or unwelcomed, for various reasons). What would be the best way to drop the client session at this point? Calling Client.Close does not seem to do anything, since the real connection doesn't seem to be ready until the OnClientConnect event is triggered. After TriggerClientConnect() is called (the next step in the chain), the state of the client is checked, and whether the handler destroyed it, but nothing is checked after TriggerClientCreate() is called. I was wondering if this is an oversight or if this is by design -- in which case, I should perform my checks on that event handler (?). Seems to me that if the server decides to not accept the connection, I should be able to drop it as soon as possible. Can anybody offer any suggestions? Thanks, -dZ. -- 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
Re: [twsocket] Another BCB2007 compatibility problem (of demos)
RAD Studio 2007 brings ICS? Is it in the additional components, or as part of the default distribution? -dZ. --- Original Message --- From: Francois PIETTE[mailto:[EMAIL PROTECTED] Sent: 10/1/2007 12:19:57 PM To : twsocket@elists.org Cc : Subject : RE: Re: [twsocket] Another BCB2007 compatibility problem (of demos) Have you used ICS version which included in RAD Studio 2007 ? -- [EMAIL PROTECTED] The author of the freeware multi-tier middleware MidWare The author of the freeware Internet Component Suite (ICS) http://www.overbyte.be - Original Message - -- 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
Re: [twsocket] Cancelling TWSocketServer client connection
Francois, Thanks for your response. I understand what you are saying, and will change my code accordingly. However, it occurs to me that a lot of processing seems to be occurring from the moment the client arrived until the connection is established and the OnClientConnect event is fired; and if the client needs to be dropped for some reason, all this processing is wasted. Would it then be a good idea to offer a cancelling mechanism from the first event that would skip all the rest? I could work on something if you think its worth it. -dZ. --- Original Message --- From: Francois PIETTE[mailto:[EMAIL PROTECTED] Sent: 10/1/2007 12:35:46 PM To : twsocket@elists.org Cc : Subject : RE: Re: [twsocket] Cancelling TWSocketServer client connection At the time OnClientCreate is called, the socket is not assigned yet to the connection. So it is not easy to cancel the connection. OnClientConnect is a better place. From there you can call Shutdown to terminate the connection you don't want. Have a look at the source code for TCustomWSocketServer.TriggerSessionAvailable. -- [EMAIL PROTECTED] The author of the freeware multi-tier middleware MidWare The author of the freeware Internet Component Suite (ICS) http://www.overbyte.be - Original Message - -- 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
[twsocket] TWSocketThrdServer graceful shutdown
Hello: I using TWSocketThrdServer in a server application and was wondering if there is a recommended method to call for a graceful shutdown -- one that will stop listening when all current connections are completed. Thanks, -dZ. -- 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
Re: [twsocket] TWSocketThrdServer graceful shutdown
Thanks Wilfried. Close() will do it. What then does Shutdown(x) do? I see that Close() calls it with an argument of 1 (SD_SEND), which according to a comment is for graceful close. Does it stop sending data? -dZ. --- Original Message --- From: Wilfried Mestdagh[mailto:[EMAIL PROTECTED] Sent: 9/28/2007 12:03:57 PM To : twsocket@elists.org Cc : Subject : RE: Re: [twsocket] TWSocketThrdServer graceful shutdown Hello dz, Just call Close method. server will stop listening. Note that calling Close will not stop current connections, it only stops listening. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Friday, September 28, 2007, 17:44, [EMAIL PROTECTED] wrote: Hello: I using TWSocketThrdServer in a server application and was wondering if there is a recommended method to call for a graceful shutdown -- one that will stop listening when all current connections are completed. Thanks, -dZ. -- 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
Re: [twsocket] TWSocketThrdServer graceful shutdown
--- Original Message --- From: Arno Garrels[mailto:[EMAIL PROTECTED] Isn't this list great? Where else do you get faster support for free software? g Yes, it is. Thank you both for your quick responses. -dZ. -- 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
[twsocket] TWSocket multi-client example
Hello: I need to write a TService application that will receive (potentially) multiple client TCP connections concurrently, and perform some simple stateful transactions with them. For example: 1. Client-A connects to the server 2. Server responds with banner 3. Client-A sends data 4. Client-A sends end-of-data marker 5. Server responds with ERR or OK code 6. Server responds with receipt ID 7. Client-A closes connection As you can see, its sort of like an SMPT server, but much, much simpler. Does TWSocket support multiple concurrent connections? If not, do I need to implement this by spawning a new thread for each client, or is there a more efficient way? Is there an example of such application? From what I found in the ICS demo applications, some use multiple forms for each client. Any guidance or samples will be very much appreciated. Thank you, -dZ. -- 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
Re: [twsocket] httpcli v6 bad request
That's for general URI (Uniform Resource Identifier). I believe RFC #1738 covers URL (Uniform Resource Locator) specifically. It narrows down considerably the scope of escaping as only a few valid combinations, characters, and formats are valid for WWW addresses. -dZ. --- Original Message --- From: Arno Garrels[mailto:[EMAIL PROTECTED] Sent: 4/20/2007 10:41:53 AM To : twsocket@elists.org Cc : Subject : RE: Re: [twsocket] httpcli v6 bad request [EMAIL PROTECTED] wrote: --- Original Message --- From: Francois PIETTE[ mailto:[EMAIL PROTECTED] Sent: 4/19/2007 2:46:48 PM To : twsocket@elists.org Cc : Subject : RE: Re: [twsocket] httpcli v6 bad request Agreed, so we need a FAST routine. URLEncode currently isn't smart enough to encode a complete URL, and it is slow (result := result + ..) Next question is how smart should such a routine act? Should it check for a valid URL in general or shall it just check for valid encoding? Should it auto-complete incomplete as well as auto-correct invalid URLs like IE? When you start thinking about this stuff the routine in mind becomes slower and slower :( Making URLEncode faster is probably enough for the component. Checking valid URL and autocomplete is another thing. I don't know if this is what Arno had in mind with the validation, but as I mentioned before, there is one more catch: what if the application encoded the URL to begin with? Then all percent symbols will be re-encoded and the URL mangled. For this reason you either need to unencode-reencode (slow!), or check for encoding and only encode if necessary. RFC2396 sounds rather complicated: 2.4.2. When to Escape and Unescape A URI is always in an escaped form, since escaping or unescaping a completed URI might change its semantics. Normally, the only time escape encodings can safely be made is when the URI is being created from its component parts; each component may have its own set of characters that are reserved, so only the mechanism responsible for generating or interpreting that component can determine whether or not escaping a character will change its semantics. Likewise, a URI must be separated into its components before the escaped characters within those components can be safely decoded. ( http://www.faqs.org/rfcs/rfc2396.html ) We probably have to bind encoding to function ParseUrl() somehow. -- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html -dZ. -- 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
Re: [twsocket] httpcli v6 bad request
Frans, As I mentioned before, replacing spaces will still leave you open to other invalid characters. If you want a quick fix for your current problem, then I suggest URL-encoding the entire URL instead of just the the spaces. Its been a while since I've used HttpCli, so I'm not sure if it provides one, but creating a URL encoding function is not that hard (its basically turning every invalid character into a code of the form %XX where XX represents the ASCII code for character in Hex), contact me privately if you need help with it. As a long term solution, if Francois really wants to replicate browsers' behavior, then the URL must be URL-encoded at the latest moment when the request is being constructed to cover all possible capture points. Notice that this will involve a 2 step process: URL-decode and then URL-encode, to compensate for strings that have already been encoded by the application externally. -dZ. --- Original Message --- From: Frans van Daalen[mailto:[EMAIL PROTECTED] Sent: 4/19/2007 6:54:57 AM To : twsocket@elists.org Cc : Subject : RE: Re: [twsocket] httpcli v6 bad request In my Ethereal dump the location-header of the 301-response already has the space, so the server simply tries to redirect to an invalid URL, do we really have to workaround such invalid URLs in the THttpCli? With followRelocation := True this URL will generate a 400 on ThttpCli with absolutly no option to solve it except with a more or less illegal httpClient.FPath := stringreplace(httpclient.fpath,' ','%20',[rfreplaceall]); IE, Opera and possible other browser however will not generate a 400. I have no control over servers that generate a more or less invalid URL and it its hard to explain to any user why such a url is oke with IE etc and not with any ICS based product. As a reminder a quote from Francois in another posting I remember long time ago we discussed this topic (post changed to get after relocation) and we concluded that it must be done so because most browser do not follow the standard and not doing like the browser will result in failure. That is probably how a bug in a well known browser become a de-facto standard ! Like it or not, if you don't do the same, your program will be accused of malfunction even if it perfectly follow the standard. And to add to this: I needed more then a few days before finally finding this one, it's onyl one single space that caused this :-) -- 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
Re: [twsocket] httpcli v6 bad request
--- Original Message --- From: Francois PIETTE[mailto:[EMAIL PROTECTED] Sent: 4/19/2007 2:46:48 PM To : twsocket@elists.org Cc : Subject : RE: Re: [twsocket] httpcli v6 bad request Agreed, so we need a FAST routine. URLEncode currently isn't smart enough to encode a complete URL, and it is slow (result := result + ..) Next question is how smart should such a routine act? Should it check for a valid URL in general or shall it just check for valid encoding? Should it auto-complete incomplete as well as auto-correct invalid URLs like IE? When you start thinking about this stuff the routine in mind becomes slower and slower :( Making URLEncode faster is probably enough for the component. Checking valid URL and autocomplete is another thing. I don't know if this is what Arno had in mind with the validation, but as I mentioned before, there is one more catch: what if the application encoded the URL to begin with? Then all percent symbols will be re-encoded and the URL mangled. For this reason you either need to unencode-reencode (slow!), or check for encoding and only encode if necessary. -dZ. -- 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
Re: [twsocket] httpcli v6 bad request
The main issue is however that with the followrelocate set it will generate an error while a browser will not. As has been stated before, that is not the main issue. The main issue is that the HttpCli component does not perform *any* encoding of URLs prior to sending a request to the server, which runs contrary to the behaviour of any standard browser. It just so happens that the problem manifested itself in your case as a relocation address with as space on it. I do not agree that this is a relocation-specific issue, and if we want the component to mimic the expected behaviour of standard browsers, it needs to automatically encode all URLs when composing the request, at the latest point when the location address has been commited immutably. This means that it has to compensate for pre-encoded URLs (just like standard browsers do: give IE an encoded URL and it will leave it alone, give it one with funky characters and it will encoded it). -dZ. --- Original Message --- From: Frans van Daalen[mailto:[EMAIL PROTECTED] Sent: 4/19/2007 3:58:57 PM To : twsocket@elists.org Cc : Subject : RE: Re: [twsocket] httpcli v6 bad request my 2 cents on this : If you feed Thttpcli.url with a invalid url no urldecode is executed. To keep consistency in behavior I would not just do an automatic urldecode on a relocate. The main issue is however that with the followrelocate set it will generate an error while a browser will not. To allow a programmer to make a decision on an invalid relocate url the component must provide an option to do so. I therefore see 3 possible solutions. 1) A new property AutoDecodeRelocationUrl type Boolean. Default FALSE. If set TRUE will execute a urldecode on the relocate AND possible on the httpcli.url also. But if it include the later option as well the name maybe should be AutoUrlDecode. 2) A new event OnRelocationRecieved(data : String; Accept : Boolean) to be called around line 2675 (procedure getheaderlinenext) -- { co=32js=1.4sr=1024x768re= http://www.thesite.com/you.html } FLocationFlag := TRUE; if Proxy '' then begin -- something like -- { co=32js=1.4sr=1024x768re= http://www.thesite.com/you.html } baccept := true; if Assigned(FOnRelocationRecieved) then FOnRelocationRecieved(data,baccept); If baccept then FLocationFlag := TRUE; if Proxy '' then begin -- This would allow the programmer to temporary overrule the FFollowRelocation setting on demand but also allow adjustment of the received header data. I think that would enhance flexibility. 3) A change to the procedure getheaderlinenext to just change the received data. In my opion not the best option as it can cause confusion about what is really received. Feedback appreciated : -- 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
[twsocket] TWSocket and TWSocketServer TCP Header (full packet)
hi to all community, I'm in trouble about a problem: is it possible to get FULL TCP PACKET (Header + Data)?? In OnDataAvaiable event I've got just the Data but nothing about Sequence_Number, Flags, IDs etc..etc.. Thx in advance -Antony- -- Passa a Infostrada. ADSL e Telefono senza limiti e senza canone Telecom http://click.libero.it/infostrada -- 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
Re: [twsocket] SMTP connection limit
Hello: Most ISP's SMTP servers limit the amount of concurrent connections from the same source to about 10 or 20. This is intended to prevent automatic spamming and mail bombing runs, or to at least hinder or limit their impact. This is pretty much an industry standard nowadays (along with rejecting connections from dynamic IP addresses). Making the limit configurable is a good idea, and I would suggest a default limit of no more than 20. Like Arno said in his post, asynchroneous connections to the same server do not necessarily increase performance significantly so it shouldn't matter that much to the user. -dZ. --- Original Message --- From: Veit Zimmermann[mailto:[EMAIL PROTECTED] Sent: 3/8/2007 6:42:03 AM To : twsocket@elists.org Cc : Subject : RE: [twsocket] SMTP connection limit Hi Are there providers which limit the number of concurrent SMTP connections? In other words: Do I have to make the maximum number of connections for asynchronous operation flexible and what would be a good practice approach (besides making it user configurable). TIA -- 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
[twsocket] FTPClient specifying a port other than 21...
Thanks for the previous posts. I guess the bottom line is, does FTPClient work with other ports besides port 21 for the version last revised: Apr 18, 2003. I am currently using Delphi 3? I have tried specifying other ports but receive the message 10060 on a file transmit as previously reported. Thanks in advance, James -- 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
[twsocket] FTP Client specifying a port and getting a 10060 error...
We have been using FTPClient and FTPServer for transmitting files with the default 'ftp' port. When I allow the user to specify a port we get the message Error = 10060 (500 Connection timed out (Winsock error #10060) on the FTP transmet. The Username and Password functions work correctly but on the file transmit is when we get the error. Any help would be greatly appreciated. Thanks, James -- 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
Re: [twsocket] POP3
Hello: I haven't worked with POP3 authentication, so I can't answer those questions, but at least I can give you an answer to your first question: --- quote: What is the difference between Open and Connect? Is it that Connect simply gets the server's attention, so to speak, such that User, Pass etc can be sent as required, while Open encapsulates the process into one step? Or am I way off with this? --- end. You are absolutely correct. -dZ. -- 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
[twsocket] Ftp Client Send Error 426 using dialup connnection...
We have a polling program that for years has pushed information to head office using ICS component suite. Recently we have tried to also pull information back using the FTPClient.Receive function. Everything worked good in testing on high speed. The problem we have is that when connnect with dialup connection after about300-500k is transferred we get a 100057 on FTP Server side and on client side we get error 426. I was wondering if there are options on the FTPClient or FTPServer component to faclitate transmissions at slower speeds. As I said we have had no problems transferring files with high speed. Thanks, James -- 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
Re: [twsocket] Idea about forming a new mailing list
What is the goal, to find a cheap way to market your products? -dZ. --- Original Message --- From: Fastream Technologies[mailto:[EMAIL PROTECTED] Sent: 11/27/2006 10:32:42 AM To : twsocket@elists.org Cc : Subject : RE: Re: [twsocket] Idea about forming a new mailing list Hello, Ok, what about a third-party-ICS-tools elists.org emailing list? Best Regards, SZ -- 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
Re: [twsocket] SmtpClient problem on disconnect
We've been talking this topic many times. The RFCs say that the server has to close the connection, so if a server doesn't close the connection on receiving command QUIT the server is buggy. You can handle those server-side bugs with a simple command timeout, in real applications some a timeout mechanism is required anyway. I agree with Arno: breaking the connection after the QUIT command without closing it normally, breaks RFC compliancy and is a bug. Sometimes it is a good idea to modify the components to handle common idiosyncracies of servers that are common, in order to make it more robust. However, in this case, a simple timeout event, as recommended, would correct your problem; and since it is a good idea to implement a command timeout on networking applications anyway, it is not necessary to modify the component to handle this issue. -dZ. -- 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
Re: [twsocket] SMTP Control: Email header appears in body of email
To clarify what I meant: my company uses Outlook for all its email. Viewing one of said problematic letters in the Preview/View pane should just show the body of the email. Instead, all the header lines were displayed, too. Like I mentioned, this is probably Outlook choking on large header lines. Turning on the FoldHeader option solved the problem for me. Great. I still think you should consider one of the other options for large quantities of recipients. -dZ. -- 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
Re: [twsocket] How to handle a failed CWD with FTPClient...
So you should first change the working directory to the root path and then try the second CWD command with the a\b\c\d HostDirName ... No, that would require an extre round-trip. As others have pointed out, you should use absolute paths by starting all your paths with a '/' (or '\' in the case of Windows). If a path does not start with the directory separator, the server will interpret it as a path relative to the current directory. Since you seem to be dropping the connection whenever your CWD fails (unnecessary, really), the next time that you re-connect it'll start again in the top directory, and so that's why re-trying the same directory after failing worked. -dZ. -- 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
Re: [twsocket] Wiki
Hello: What happened was that I had forgotten my password, so I created a new account. I am now able to log in with my old password and I can edit. However, I still suggest you add a message when creating new accounts that says that the user needs to request permissions in order to edit (or something like that). Thank you, -dZ. --- Original Message --- From: Francois PIETTE[mailto:[EMAIL PROTECTED] Sent: 10/1/2006 9:54:10 AM To : twsocket@elists.org Cc : Subject : RE: Re: [twsocket] Wiki I also get the same thing on every article. I checked, you are a Sysop just like me. I edited the main page and it worked. Please try again. Fredrik I have a login to the Wiki but the content I want What is your login ? Is it Frla ? If yes, then you don't have permission to edit. Did you had it previously ? Confirm your login name (privately) and I'll give you write permission. -- Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] http://www.overbyte.be - Original Message - From: [EMAIL PROTECTED] To: twsocket@elists.org Sent: Saturday, September 30, 2006 11:30 PM Subject: Re: [twsocket] Wiki I also get the same thing on every article. Do we have to wait for a moderator to give access? If so, I would suggest you add a comment to that effect when a new user registers. -dZ. --- Original Message --- From: Fredrik Larsson, LC[ mailto:[EMAIL PROTECTED] Sent: 9/30/2006 5:07:26 PM To : twsocket@elists.org Cc : Subject : RE: Re: [twsocket] Wiki I have a login to the Wiki but the content I want to add information said Project:Protected page? -- 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 -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -- 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
Re: [twsocket] Wiki
I also get the same thing on every article. Do we have to wait for a moderator to give access? If so, I would suggest you add a comment to that effect when a new user registers. -dZ. --- Original Message --- From: Fredrik Larsson, LC[mailto:[EMAIL PROTECTED] Sent: 9/30/2006 5:07:26 PM To : twsocket@elists.org Cc : Subject : RE: Re: [twsocket] Wiki I have a login to the Wiki but the content I want to add information said Project:Protected page? -- 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
Re: [twsocket] How to send e-mail directly to the recipient's SMTPserver?
--- Original Message --- 2) How I will be able to connect in the SMTP server if I only have the email account and I do not have the password? What do you mean with connect ? Under normal circumstances, you would connect to your local SMTP Server (or your ISP's) to send e-mail. In your particular case, you want to connect directly to the recipient's SMTP server. The first thing to do is to find out the server's address, and you do this by performing a DNS Query and checking the MX (Mail Exchanger) record: You take the e-mail address, split it on the '@' symbol, and take the part on the right side -- that should be the network's domain. You perform the MX record query against this domain, and it should return the host address of the SMTP server that serves that domain. Note that this is not the same as trying to connect directly to the domain name, as most of the time this may not work. (I'm sorry I can't help with that part, because I've never used TDNSQuery.) For example, suppose you have this list's address: twsocket@elists.org. You take the domain part, elists.org, and perform a DNS query for the MX record, and the query returns the actual address of the mail server that serves elists.org: mail.elists.org. Once you have the SMTP server's host address, you set that as the host property of the TSMTPCli component, and then perform the SMTP transaction as usual. One thing to understand is that connecting to a remote SMTP server depends on that server accepting you as a valid external server. This is important. It means that if the SMTP server requires some sort of authentication, and you are not a local user (and therefore do not have valid credentials), you won't be able to connect. That said, remote servers *should* allow external connections when the recipient is local (how else would the users ever receive mail from the outside world?). I say should, because there may be some restrictions. For instance, the server may require you to have a valid SPF record, or may perform some look-up in anti-spam databases to make sure you are not a known open-relay host, etc. Also, most, if not all, major ISP networks block direct SMTP connections from dynamic IP addresses (this includes Dial-Up as well as Broadband connections). I hope this helps. -dZ. -- 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
Re: [twsocket] How to send e-mail directly to therecipient'sSMTPserver?
Yes, that is definitely a problem. Another alternative would be to ask the user (sender) for his e-mail address and credentials (if necessary), and use *his* ISP's SMTP server for the transaction. That way, the SMTP server is still dynamically determined according to the user. Or perhaps set up a centralized SMTP server on your network, and set up a proper PTR DNS record (for reverse DNS lookup), and have all your clients use that -- but I understand that this may not be feasible. Sorry, -dZ. --- Original Message --- From: marcos nobre[mailto:[EMAIL PROTECTED] Sent: 9/21/2006 10:49:52 AM To : twsocket@elists.org Cc : Subject : RE: Re: [twsocket] How to send e-mail directly to therecipient'sSMTPserver? The problem?! The main problem is that fact of most SMTP servers reject connections from dynamic IP ranges. Most server policies also reject a connection if the IP cannot be reverse looked up. My program (application) in almost time act as a mobile program (solution), in which it's user is using a Broadband connection or Dial-up one, and is sending and receiving e-mails from/to his partners. MN. On 9/21/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Ooops You help a lot. Very, very thanks for the lesson ! No problem. I understood what to do, and also understood that still remains some type of problem in the solution that I intend to implement. What kind of problems? What is the overall solution you want to implement? -dZ. -- 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 -- 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
[twsocket] ICS SSL with Delphi 2005
I downloaded the ICS SSL 5g and ICS SSL 5 but there is no project File for Delphi 2005 (WITHOUT .NET) like it is in the freeware version. Also I Can't compile with the Delphi 7 or Delphi 2006 project File. Wherefrom can I get a Delphi 2005 project file ? Thorsten -- 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
[twsocket] socketserver multicast
Hello What is Multicast and MulticastString properties of TWSocketServer? Can tou give me details, please? Thank you Radu ___ No banners. No pop-ups. No kidding. Make My Way your home on the Web - http://www.myway.com -- 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
Re: [twsocket] socketserver multicast
But are they of use in TWSocket ? --- On Fri 03/24, Francois Piette [EMAIL PROTECTED] wrote: From: Francois Piette [mailto: [EMAIL PROTECTED] To: twsocket@elists.org Date: Fri, 24 Mar 2006 14:10:32 +0100 Subject: Re: [twsocket] socketserver multicast What is Multicast and MulticastString properties of TWSocketServer? Can tou give me details, please?Those properties are inherited from TWSocket and are of no use in TWSocketServer.--Contribute to the SSL Effort. Visithttp://www.overbyte.be/eng/[EMAIL PROTECTED] of ICS (Internet Component Suite, freeware)Author of MidWare (Multi-tier framework, freeware)http://www.overbyte.be-- To unsubscribe or change your settings for TWSocket mailing listplease goto http://www.elists.org/mailman/listinfo/twsocketVisit our website at http://www.overbyte.be ___ No banners. No pop-ups. No kidding. Make My Way your home on the Web - http://www.myway.com -- 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
[twsocket] receivefiles from Wilfried - trouble
Hello Using RcvFile application provided by Wilfried Mestdagh I had some error at simultaneous receiving of files. Details: I lunch srvfile.exe on a machine a put it in listen mode. After that I launch 2 sndfile.exe (clients) on other 2 machines in the same lan. If the clients send files one at a time, it works ok, the server receives all files, no problem. But if the first client sends a file and the second client sends another file simultaneously or at short time (the first transfer is not complete), the server has three behaviours: 1. works sometimes 2. receives the first transfer in good parameters but the second fails (and there are errors displayed in log) 3. receives the first transfer in good parameters but the second fails (and there are no errors displayed in log) I want the server to: 1. receive files one at a time 2. put the second (third, 4th, etc) file on hold until previous file is received completely Is there a method for this ? ___ No banners. No pop-ups. No kidding. Make My Way your home on the Web - http://www.myway.com -- 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
[twsocket] ics under kylix ?
I want to make a TWSocket server under kylix3. This server will accept incoming connections from clients and will offer some strings. But the question is: Can I compile server under kylix3? ICS I saw is not for kylix. ___ No banners. No pop-ups. No kidding. Make My Way your home on the Web - http://www.myway.com -- 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
[twsocket] which ip is used ...
I have a small question. How can I find which ip I use when connecting to server? I have several IP's configured on my laptop and a Sendfile client. I configure the server on another machine to listen to port 2 and the rx/tx works fine. But how can I find which is my local ip the sendfile event is triggered ? Thx Radu ___ No banners. No pop-ups. No kidding. Make My Way your home on the Web - http://www.myway.com -- 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
[twsocket] create custom Client for Microsoft Networks
Sorry, the previous mail was send empty by an error. Does anyone knows something about how can I create a custom Client for Microsoft Networks. It must provide more functions than the usual one and I don't know where to start. Thank you Radu ___ No banners. No pop-ups. No kidding. Make My Way your home on the Web - http://www.myway.com -- 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
[twsocket] send file to a http link or to a linux address using ICS
Hello Is it possible to send a file from a windows machine from, lets say d:/testfile.txt to a weblink (like http://192.168.0.1/datas/upload/) or phisical address (like //192.168.0.1/datas/upload/) on linux using ICS? Assuming that I don't want to install FTP on linux server, is it still possible? Do you know what is the best way to do this ? Radu ___ No banners. No pop-ups. No kidding. Make My Way your home on the Web - http://www.myway.com -- 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
[twsocket] twsocket cpu usage
Hello Is there a way to limit the cpu usage when receiving files thru TWsocket? Usualy CPU is 90-100% used and the computer freezes for the time the transfer is made. Radu ___ No banners. No pop-ups. No kidding. Make My Way your home on the Web - http://www.myway.com -- 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
Re: [twsocket] twsocket cpu usage
Indeed the data transfered is continously transfered at high speed and it is written directly to disk. Which is the best method I could use to slow cpu usage? - make a timer and send data whith interrupts (but how to make a timer whith 0.2 seconds step for example?) - find somehow a component that limits bandwidth so that data to be forced to be send in slower motion - other method Radu --- On Thu 03/16, Wilfried Mestdagh [EMAIL PROTECTED] wrote: From: Wilfried Mestdagh [mailto: [EMAIL PROTECTED] To: twsocket@elists.org Date: Thu, 16 Mar 2006 14:55:13 +0100 Subject: Re: [twsocket] twsocket cpu usage Hello Radu,It is also possible if you send / receive very mutch data at high speedand save to disk or so. This take some time and meanwhile next chunck isprobably already received.If this is the reason then you can slow down the sending a little bywaiting a littel between data chuncks. You can do this using a timer forexample.---Rgds, Wilfried [TeamICS]http://www.overbyte.be/eng/overbyte/teamics.htmlhttp://www.mestdagh.bizThursday, March 16, 2006, 13:50, [EMAIL PROTECTED] wrote: Hello Is there a way to limit the cpu usage when receiving files thru TWsocket? Usualy CPU is 90-100% used and the computer freezes for the time the transfer is made. Radu ___ No banners. No pop-ups. No kidding. Make My Way your home on the Web - http://www.myway.com-- To unsubscribe or change your settings for TWSocket mailing listplease goto http://www.elists.org/mailman/listinfo/twsocketVisit our website at http://www.overbyte.be ___ No banners. No pop-ups. No kidding. Make My Way your home on the Web - http://www.myway.com -- 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
[twsocket] Minichat problem
Hello My project implies creating a chat application. There one user will login and chat with the other online user. Minichat is suitable for my project and very helpful. But I have one problem: what should I do so that PrvForm (the client form) should not be a MDIChild? I want that every PrvForm window to be opened independently and each opened window to have a separate window in taskbar(as in Yahoo Messenger) not in the main window. Could you provide me hints about this problem ? Thank you Radu ___ No banners. No pop-ups. No kidding. Make My Way your home on the Web - http://www.myway.com -- 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
[twsocket] TFPClient1 (determinign whether to put or appendfile)
I've go a Client App that sends a data file to a centralised server using Francois's FTPClient1 routines. From time to time the Server will remove the uploaded file. Is there a clever way of working out whether the data file is present on the server to determine whether I can do a PUT or APPEND/APPENDFILE. I have tried to decode the result of the SIZE command but that has proved very unreliable. With thanks and bonne année. Ed -- 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
[twsocket] FTPClient not ready
hi All, In my application i have 3 TTimer compents that on interval time send ftp command with TFtpClient components. I control this procedure on OnRequest event but the component say FTPclient not ready; how make to control this event, why ? Thank in advanced. Marco. Italy -- 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
Re: [twsocket] TnEmulVT: Number Rows - Important!!!!
Hi Steve, That is the correct answer, but there is a small detail that with himself not to discover. I have made a test with an application already developed and after sending code IAC, the client recive again the screen that it had previously but resize to the new size. In my case, after sending commando IAC, receipt nothing and the screen is updated Somebody can help me? Thanks in advance. Mensaje original De: [EMAIL PROTECTED] Recibido: 07/09/2005 8: 50 Para: ICS support mailingtwsocket@elists.org Asunto: Re: [twsocket] TnEmulVT: Number Rows - Important Francois Piette wrote: Yes, seem to be some communication problems. I think he is looking for the telnet escape sequence to notify the server that the terminal size has changed. Maybe it is in the telnet rfc, I'm not sure. If that's the question, I don't know the answer. I was even not aware that such esc sequence existed ! Maybe it is this one. Telnet Window Size Option ftp://ftp.rfc-editor.org/in- notes/rfc1073.txt -- Sly This message and its attachments may contain legally privileged or confidential information. This message is intended for the use of the individual or entity to which it is addressed. If you are not the addressee indicated in this message, or the employee or agent responsible for delivering the message to the intended recipient, you may not copy or deliver this message or its attachments to anyone. Rather, you should permanently delete this message and its attachments and kindly notify the sender by reply e- mail. Any content of this message and its attachments, which does not relate to the official business of the sending company must be taken not to have been sent or endorsed by the sending company or any of its related entities. No warranty is made that the e-mail or attachment(s) are free from computer virus or other defect. -- 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
Re: [twsocket] TnEmulVT: Number Rows
Hi Francois, That option already I proved it but I did not have the awaited result. As it commented in the previous mail, when the size of the window of the terminal changes, Windows program Telnet is even sent a package to the Host but not his content and not if the one is that package that somehow says to him to host that I have changed the line number. In case it serves for something, I am connecting me to a Linux Red Hat ES Thanks in advance. Carlos. Mensaje original De: [EMAIL PROTECTED] Recibido: 06/09/2005 10:35 Para: ICS support mailingtwsocket@elists.org Asunto: Re: [twsocket] TnEmulVT: Number Rows Have a look at EmulVT source code (you have it !), there are two constants that define the screen size: MAX_COL and MAX_ROW. -- 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: [EMAIL PROTECTED] [EMAIL PROTECTED] To: twsocket@elists.org Sent: Tuesday, September 06, 2005 10:14 AM Subject: Re: [twsocket] TnEmulVT: Number Rows Probably I have not explained myself well, I am making a terminal with TNemulVT, that by defect has 25 lines, but when I change the size of the window of the terminal does not increase the line number that can show to me. I have made a test with the program TeraTerm and if I have the publisher vi and if increase the size of the window, increases the line number in the publisher. With sniffer I have been capturing the packages that are transmitted between host and the so single terminal and is a package that is sent from the terminal to host, but I do not understand its content. The data of the package is: ÿú..P.*** Excuses because my English surely is not very clear Thanks in advance. Carlos. Mensaje original De: dr. [EMAIL PROTECTED] co.uk Recibido: 05/09/2005 14:52 Para: twsocket@elists.org Asunto: [twsocket] TnEmulVT: Number Rows Your email implies that the increased lines works with other programs. This suggests the 'vi' program may be sending an initialisation sequence to your terminal emulator, resetting the number of lines. Regards Dr John -- 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 -- 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
Re: [twsocket] TnEmulVT: Number Rows - Important!!!!
I have been more than 10 years programming in Delphi and I can assure to you that what is a component and so that it serves. Attempt to develop an emulator of terminal with the TnEmulVT component, I do not want to use Windows Telnet, but what if I can say to you, it is that surprises enough your answer to me. It seems that you have gotten upset after there is your first answer responds to you that already I have changed it and that does not work, was not my intention. I believe that you would have to speak with more education to the people who have doubts of like using ICS. And if they bother to you these questions you do not answer them. Carlos. Mensaje original De: francois. [EMAIL PROTECTED] Recibido: 06/09/2005 11:11 Para: ICS support mailingtwsocket@elists.org Asunto: Re: [twsocket] TnEmulVT: Number Rows If Windows Telnet does want you want, use it. If you want to have some features with your own program using ICS, you must for sure develop yourself some code. A component is not a complete program. -- [EMAIL PROTECTED] http://www.overbyte.be - Original Message - From: [EMAIL PROTECTED] [EMAIL PROTECTED] net To: twsocket@elists.org Sent: Tuesday, September 06, 2005 10:55 AM Subject: Re: [twsocket] TnEmulVT: Number Rows Hi Francois, That option already I proved it but I did not have the awaited result. As it commented in the previous mail, when the size of the window of the terminal changes, Windows program Telnet is even sent a package to the Host but not his content and not if the one is that package that somehow says to him to host that I have changed the line number. In case it serves for something, I am connecting me to a Linux Red Hat ES Thanks in advance. Carlos. Mensaje original De: [EMAIL PROTECTED] Recibido: 06/09/2005 10:35 Para: ICS support mailingtwsocket@elists.org Asunto: Re: [twsocket] TnEmulVT: Number Rows Have a look at EmulVT source code (you have it !), there are two constants that define the screen size: MAX_COL and MAX_ROW. -- Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- francois. [EMAIL PROTECTED] Author of ICS (Internet Component Suite, freeware) Author of MidWare (Multi-tier framework, freeware) http: //www. overbyte.be - Original Message - From: [EMAIL PROTECTED] [EMAIL PROTECTED] To: twsocket@elists.org Sent: Tuesday, September 06, 2005 10:14 AM Subject: Re: [twsocket] TnEmulVT: Number Rows Probably I have not explained myself well, I am making a terminal with TNemulVT, that by defect has 25 lines, but when I change the size of the window of the terminal does not increase the line number that can show to me. I have made a test with the program TeraTerm and if I have the publisher vi and if increase the size of the window, increases the line number in the publisher. With sniffer I have been capturing the packages that are transmitted between host and the so single terminal and is a package that is sent from the terminal to host, but I do not understand its content. The data of the package is: ÿú..P.*** Excuses because my English surely is not very clear Thanks in advance. Carlos. Mensaje original De: dr. [EMAIL PROTECTED] co.uk Recibido: 05/09/2005 14:52 Para: twsocket@elists.org Asunto: [twsocket] TnEmulVT: Number Rows Your email implies that the increased lines works with other programs. This suggests the 'vi' program may be sending an initialisation sequence to your terminal emulator, resetting the number of lines. Regards Dr John -- 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 -- 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 -- 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