Re: [twsocket] OnDataAvailable non-lined mode question
Hello Dod, Using line mode OFF, if I do for example a .Send of 500 bytes, the receiver should get just one OnDataAvailable event. Mostly, but not for sure. You can also receive more bytes if the sender sends a second packet a little later. TCP does not respect packet boundary. If it will produce miltple OnDataAvailable, is there a way to predict how many time it will be triggered ? No it is not predictable. Please read TCP/UDP primer on overbyte website. If you dont use LineMode then you have to include the length of each packet in it, or tell the receiver what he expect to receive by means of a protocol. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Monday, February 13, 2006, 10:29, Dod wrote: Hello, Using line mode OFF, if I do for example a .Send of 500 bytes, the receiver should get just one OnDataAvailable event. But if I send a 100KB buffer, will I receive get a OnDataAvailable after those 100KB are sent or will it be triggered XX times depending the network path (and possible packet split) between sender and receiver. If it will produce miltple OnDataAvailable, is there a way to predict how many time it will be triggered ? Regards. -- 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] Encode URL
On Feb 12, 2006, at 22:15, David A. G. wrote: The URL must be encoded because may have illegal characters: The user may enter an URL like: http://www.site.com/fol 1/fol 2/file 1.jpg?par=sdf|dfgó.jpg This URL must be encoded as: http://www.site.com/fol%201/fol%202/file%201.jpg?par=sdf%7Cdfg%F3.jpg Yes, but you are assuming that non-encodable characters are part of the URL; what if they were not? What if the value of par contained an ampersand symbol, a slash, an equal sign, or a question mark? Since you cannot tell which parts need to be encoded, you must use UrlEncode individually on the parts that require it, and concatenate them with the valid characters as in my example. This kind of codification must be parse-sensitive, because an URL cannot be completely encoded without taking care of Protocol, Address, Port, Folders, File and Parameters (..and Authentication and Bookmark information). Again, you are assuming that it is straight-forward. The atoms for the server part are predictable: protocol, FQDN, port, path, filename, but anything after that is not, which is the reason why escaping is necessary, because valid delimiters can be part of parameter names or values. 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://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Encode URL
Yes dZ you have right, if you have a Param containing reserved characters always must be PRE encoded (I can use Base64 or a Post method). But my problem is just an URL containing characters valid for standard Filenames. ...I was finding a function to do something like IE does in the address bar. - Original Message - From: DZ-Jay [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Monday, February 13, 2006 7:09 AM Subject: Re: [twsocket] Encode URL On Feb 12, 2006, at 22:15, David A. G. wrote: The URL must be encoded because may have illegal characters: The user may enter an URL like: http://www.site.com/fol 1/fol 2/file 1.jpg?par=sdf|dfgó.jpg This URL must be encoded as: http://www.site.com/fol%201/fol%202/file%201.jpg?par=sdf%7Cdfg%F3.jpg Yes, but you are assuming that non-encodable characters are part of the URL; what if they were not? What if the value of par contained an ampersand symbol, a slash, an equal sign, or a question mark? Since you cannot tell which parts need to be encoded, you must use UrlEncode individually on the parts that require it, and concatenate them with the valid characters as in my example. This kind of codification must be parse-sensitive, because an URL cannot be completely encoded without taking care of Protocol, Address, Port, Folders, File and Parameters (..and Authentication and Bookmark information). Again, you are assuming that it is straight-forward. The atoms for the server part are predictable: protocol, FQDN, port, path, filename, but anything after that is not, which is the reason why escaping is necessary, because valid delimiters can be part of parameter names or values. 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://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] OnDataAvailable non-lined mode question
Hello Dod, Maybe another apprach is to use always a timeout and reset it every time data is received. But then you have to send keep alive packets to not get disconnected in case there is no real traffic needed. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Monday, February 13, 2006, 11:21, Dod wrote: Hello Wilfried, OK, that is what I thought but now I am sure :-) Usually I much prefer Lined mode as it is simpler to manage, and may be used for binary transport if you take care to backslash #13 and #10. In non-lined mode I know I need to add some Size tag at beginning of buffer sending to tell receiver how sized will be data. Only thing is to add some Timer to detect too long delay before full buffer is received with something like : FOREACH CONNECTED_SOCKET as ASocket { IF (ASocket.ReceivingModeFlag=true) AND (time last packet received xx seconds) THEN send some message to socket thread to expire } Regards. WM Hello Dod, Using line mode OFF, if I do for example a .Send of 500 bytes, the receiver should get just one OnDataAvailable event. WM Mostly, but not for sure. You can also receive more bytes if the sender WM sends a second packet a little later. TCP does not respect packet WM boundary. If it will produce miltple OnDataAvailable, is there a way to predict how many time it will be triggered ? WM No it is not predictable. Please read TCP/UDP primer on overbyte WM website. WM If you dont use LineMode then you have to include the length of each WM packet in it, or tell the receiver what he expect to receive by means of WM a protocol. WM --- WM Rgds, Wilfried [TeamICS] WM http://www.overbyte.be/eng/overbyte/teamics.html WM http://www.mestdagh.biz WM Monday, February 13, 2006, 10:29, Dod wrote: Hello, Using line mode OFF, if I do for example a .Send of 500 bytes, the receiver should get just one OnDataAvailable event. But if I send a 100KB buffer, will I receive get a OnDataAvailable after those 100KB are sent or will it be triggered XX times depending the network path (and possible packet split) between sender and receiver. If it will produce miltple OnDataAvailable, is there a way to predict how many time it will be triggered ? Regards. -- 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] Fast Pings ! Delphi-BCB
Here is my code: if(pingerCount) pingers = new ::TPingThread*[pingerCount]; for(int i = 0; i pingerCount; ++i) { pingers[i] = new ::TPingThread(True); // create suspended PingAddThread(pingers[i]-ThreadID); // keep threadid so it's freed pingers[i]-FreeOnTerminate = true; //pingers[i]-PingId = pingers[i]-succ(I);// keep track of the results pingers[i]-OnTerminate = PingThreadTermPing;// where we get the response pingers[i]-PingHostName = targetServers-Strings[i]; // host name or IP address to ping pingers[i]-PingTimeout = 4000; // ms pingers[i]-PingTTL = 32; // hops pingers[i]-PingLookupReply = false; // don't need response host name lookup pingers[i]-Resume();// start it now } ... void __fastcall httpServerThread::PingThreadTermPing(TObject *Sender) { if(Terminated) return; unsigned int pingTimeInt; if(((TPingThread*)Sender)-ReplyTotal != 0) { pingTimeInt = ((TPingThread*)Sender)-ReplyRTT; } else { pingTimeInt = 4096; } } I noticed this unit ten days ago and it took my 2 hours to translate. HTH, SZ - Original Message - From: Enrique [EMAIL PROTECTED] To: twsocket@elists.org Sent: Monday, February 13, 2006 2:31 PM Subject: [twsocket] Fast Pings ! Delphi-BCB Thanks Francois, but I'm still having problems with Delphi :-( How should I translate this? // for I := 0 to Pred (T) do begin if HostNames.Lines [I] '' then begin with TPingThread.Create (True) do // create suspended begin PingAddThread (ThreadId) ; // keep threadid so it's freed FreeOnTerminate := True; PingId := succ (I) ;// keep track of the results OnTerminate := PingThreadTermPing ;// where we get the response PingHostName := HostNames.Lines [I] ; // host name or IP address to ping PingTimeout := 4000 ; // ms PingTTL := 32 ; // hops PingLookupReply := false ; // don't need response host name lookup Resume ;// start it now end ; end; end ; // I cannot understand completely these parts: for I := 0 to Pred (T) do-(Pred(T)?) with TPingThread.Create (True) do // create suspended- TPingThread* PingThread = new TPingThread(true);??? I must delete it later? And... StrPas (HostEnt^.h_name) ; - HostEnt^.h_name? SetLength (PingThreadList, Succ (Length (PingThreadList))) ; - I can't find PingThreadList, (Succ??) Thanks again !!! enri. -- 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] Fast Pings ! Delphi-BCB
This is my demo trace route application you are trying to convert. I cannot understand completely these parts: for I := 0 to Pred (T) do-(Pred(T)?) find PingThreadList, (Succ??) Pred (T) means T-1 but may be more efficient for the compiler, Succ (T) means T+1, ditto. PingThread = new TPingThread(true);??? I must delete it later? No, it deletes itself. StrPas (HostEnt^.h_name) ; - HostEnt^.h_name? SetLength (PingThreadList, Succ (Length (PingThreadList))) ; This stuff is in the component itself, you don't need to change that unless you've decided the convert the whole ping component to C++. Angus -- 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] Developing a mail client
Hi ICS team, If I plan to develop a simple mail client with SMTP / POP3 capabilities (of course) is there any comparisons available between ICS and Indy9/10 regarding this topic? Please feel welcome to share your opinion / knowledge. Thanks! -- 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] Developing a mail client
If I plan to develop a simple mail client with SMTP / POP3 capabilities (of course) is there any comparisons available between ICS and Indy9/10 regarding this topic? Comparing ICS with any other product here is out of topic. Move your question to a public forum if you need this kind of opinion. btw: There are already several mail client writen using ICS. And maybe a lot more than what I know: most authors doesn't like tio tell what tools they are using. Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] 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] Duplicate listing in TFtpServer
Hi all I have a small problem with the V6 version and Delphi 7 Clean install, tested with the tftpserver demo. When a directory have a long listing (like 100 files and directories) I got this problem with the listing more file at the top -rw-rw-rw- 1 ftp ftp 5981 Nov 21 2002 Copy (drw-rw-rw- 1 ftpftp0 Nov 21 2004 . drw-rw-rw- 1 ftp ftp0 Nov 21 2004 .. -rw-rw-rw- 1 ftp ftp16384 Feb 10 00:09 ~DF4F1E.tmp more file at the end I have remove most of the listing just to show you the problem. More I have files in the directory, more the problem occur. I have test with V5 and I don't see this problem only with V6. Thanks Marc -- 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