Re: [twsocket] Simple FTP.Put Example
Thanks for the help. As always it turns out I had a firewall issue. After resolving that I was able to figure out the appropriate steps. Happy New Year! --Johnnie Norsworthy - RE-Minder Software -- 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 FTP.Put Example
Is there a simple example of what is necessary to transmit a file using the FTP client? I am setting up the client with these properties: Up.UserName := Config.ReadString(Server,'Login','Anonymous'); Up.PassWord := Config.ReadString(Server,'Password','Anonymous'); Up.Port := Config.ReadString(Server,'Port','21'); Up.HostName := Server; Up.LocalFileName := SaveFolder+FileName; Up.HostFileName := FileName; Up.HostDirName := Config.ReadString(Server,'FTPFolder',''); Up.Timeout := 15; //seconds Up.Passive := True; But what is the methods I need to use to connect, send the file, and then disconnect? I will be doing this in synchronous mode. I see the Count parameter in FTP.OnProgress; does that represent the number of bytes sent, and do I need to initialize my progress par.maximum to the total file bytes of the local file? Thanks! -- Johnnie Norsworthy -- 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] Merry Christmas !
Merry Christmas to Everyone and Happy New Year! -- Johnnie Norsworthy -- 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] Keeping a Responsive UI during THTTPCli Download
I have a simple program that downloads a large file using the HTTP Client. How would one keep the user interface responsive during a long asynchronous download? I have tried a number of things and finally ended up adding a timer with an Application.ProcessMessages in it. Is there a better way to keep the UI responsive for button clicks and such? Thanks, -- Johnnie Norsworthy -- 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] HTTPCli v6 Download Progress
Thanks. I submitted this as a FAQ for HttpCli. -Johnnie -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
[twsocket] HttpCli Downloading Binary Files
I am having an issue with downloading by HttpCli. I am doing a really simple synchronous download of a binary file: HTTP.RcvdStream := TFileStream.Create(UpdateFileName,fmCreate); HTTP.URL := RemoteFileName; Application.ProcessMessages; HTTP.Get; TFileStream(Http.RcvdStream).Free; The file appears to be retrieved fine, and the resultant file size matches the one on the web, but it is an executable file and does not run afterward. So I am assuming it is being corrupted in some way. Is there a special mode/property for downloading binary files? I did not see any mention of it in the FAQ. I am converting a small indy application that used that HTTP component into ICS. I prefer to retrieve the web file by HTTP, but I can convert to ICS FTP is absolutely necessary. Thanks, -Johnnie Norsworthy -- 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] HTTPCli v6 Download Progress
Is there an example that demonstrates how to monitor a HTTPCli.Get() progress for displaying a progress bar? I thought I had seen mention of this in the mailing list. Is there a search engine for the mailing list? Thanks, -Johnnie Norsworthy -- 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] Confirming an Abort in THttpCli
I have a multi-threaded application that uses a dynamically created THttpCli synchronously. I know that ICS is normally used asynchronously, but I could not determine a good way to handle that with all the dynamically created threads I have to use for database access anyway. When I want to terminate the thread normally or when I force it to terminate I call the THttpCli.Abort method. How can I insure that the THttpCli component is indeed aborted before freeing it and ending the thread? Right now I do: HTTP.Abort; while HTTP.StatehttpReady do Sleep(10); Is this incorrect, unecessary or adequate? I was getting some ICS errors when freeing the thread which may have been related to freeing the THttpCli or the underlying receive stream. Thanks, -Johnnie Norsworthy -- 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] Confirming an Abort in THttpCli
I think my problems may have been with the receive stream being freed before the THttpCli was aborted. Kind of like removing the road before telling your car to stop. I am continuing to test, but was curious what other people do when THttpCli absolutely must be stopped before doing anything else. -Johnnie -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] EBay API SOAP Calls (SSL)
I can't afford to add any more expense to the project for hire I am working on right now, but I am sure I'll be donating to the SSL work for my personal projects in the future. Is is good to know it is available and *does* indeed work. For this project I was able to get Indy 9 to work. Indy 10 did not and I could never find a reason why it didn't. This is similar to other mysterious Indy quirks I have run into over the years. Thanks, -Johnnie Norsworthy -- 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] EBay API SOAP Calls (SSL)
Is the newest version of ICS capable of https: web service calls by creating your own SOAP XML? I saw an ICS example was available for Google, which was very helpful, but eBay requires an SSL connection for its web services. If someone has already done some framework for EBay in ICS or even in Indy I would gladly pay them to share that code. -- -Johnnie Norsworthy -- 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] Retrieving and Forwarding Emails / HttpCli in v6
I would like to retrieve emails from a pop3 mailbox and forward them using smtp. I haven't used ICS for emails yet and wanted to see what the process would be. I made a test program with Indy that seemed to work and I posted a message to the Borland groups to make sure there was no problem with my simple logic. But I prefer to learn and use ICS methods instead. Here is what I want to do (synchronously): Retrieve a message from a POP3 mailbox change the recipient Send it using SMTP (synchronous) change the recipient Send it using SMTP ... for a number of recipients. What I need to know is will the message remain static (no changes to the multi-parts or attachments) for the entire process, other than my changes to recipients? I can look through the examples to see how to do this. I just need to be sure it will work before I take the time to research. Second question: I didn't see an HttpCli component in v6. I had considered installing it in BDS2006 for new projects, but that is a component I use a bunch. Is it missing, or should I use version 5 HttpCli with v6 or what? Is it named differently? Thanks for ICS. I'll send my postcard next week. :-) -- -Johnnie Norsworthy -- 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] Memory leaks
On 10/9/06, Paul [EMAIL PROTECTED] wrote: It is always interesting to reuse objects instead of destroying them and recreate a fresh copy. But speaking about stream, it depends on the type of stream. A TFileStream has to be destroyed to close the file. I thought about extending HTTPCli and adding a property, CreateMemoryStreams. I use memory streams with HTTPCli and have to do this for every use. It would be nice it the create/free code was already done for me with a simple property setting. -Johnnie Norsworthy -- 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] Memory leaks
On 10/9/06, Francois PIETTE [EMAIL PROTECTED] wrote: I thought about extending HTTPCli and adding a property, CreateMemoryStreams. I use memory streams with HTTPCli and have to do this for every use. It would be nice it the create/free code was already done for me with a simple property setting. The best way to do that is not to modify the component but derive a new one and add the behaviour you like. That's what I am going to do. It's just a handy shortcut for my applications. When you derive a component from an installed component do you have to create packages for design-time installation? It would be nice if I could drop a THHTPCli on a form and then change it to a THTTPCli_DescendantName in code and be able to access the properties I added. -Johnnie Norsworthy -- 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 and POSTDATA
I am trying to pick out the cookies from some header data, and I noticed there are a few lines: Set-Cookie: Since I need to use the cookies in subsequent requests, do I need to use the OnCookie event and combine all the cookies into one line? What is used as the separator if so? Or is there a method to retrieve the combined cookie and set it to the .Cookie property? Thanks, Johnnie -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] HttpCli and POSTDATA
So it looks like I have to parse each one and form a single entry for HttpCli.Cookie with just the name=value pairs, seperated by ; . I'll try to do that now. I was used to the Indy cookie manager component which must have handled the parsing for me. I would rather do more things myself than use Indy though. Thanks, Johnnie -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
[twsocket] HttpCli and POSTDATA
I have been using fat URLs to retrieve a few web search page results, but for one site I need to use POSTDATA in the request header. How do I set my POSTDATA string before a THttpCli.GetAsync? Thanks, -Johnnie Norsworthy -- 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 and POSTDATA
POSTDATA is not included in the header but like this: POST / HTTP/1.1 Host: www.overbyte.be empty line, end of header username=userpassword=pwd (POSTDATA HERE--just like content in GET) Thanks SZ, but how do I add that to a THttpCli before calling .GetAsync? Is there an example in the ICS samples? -Johnnie -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] [OT] Borland Turbo
You can create the ICS components at run-time and set properties as needed. The only thing that usually causes problems is knowing event signatures. -Johnnie Norsworthy -- 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] About HTTP client V6 changes to support .NET
I am a newcomer to using ICS and have been very pleased with it so far. I prefer the non-blocking functions to anything I have seen in Indy, and I prefer the reduced number of components. I originally used Argosoft Internet Mail Suite before converting to Indy a couple of years ago. As far as .NET goes, I have no desire to compile the same source for multiple platforms. If ICS.NET is just similar to the Win32 library it would work for me to have a starting point. I would be using it with C# or Chrome, and certainly never VCL.NET. If VCL.NET is a requirement for ICS.NET, then I'll have to look into using another library or API when I create new .NET applications. Sidenote: My only wish for ICS is that the support from you and peer to peer was using regular newsgroups and not a mailing list. I just like them better. -Johnnie Norsworthy -- 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] Multi-Part Emails
See MailHtml sample program delivered with ICS. It does just what you need. Thanks. Sorry I missed that before. I did a search for SMTP in the folders. -Johnnie Norsworthy -- 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] Multi-Part Emails
I am current using Indy 10 to send some multi-part emails: plain text, html. Is there any example available of doing the same with ICS? I checked the FAQ and mail list archive but did not see anything. When the Indy emails are out of my application Indy is off my hard drive! :-) I just finished converting my HTTP download components to ICS, including doing some really nice asynchronouse image downloading and display that doesn't slow down my application at all. Thanks, -Johnnie Norsworthy -- 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] THttpCli - Abort .GetAsync on Received Header Contents
If I start a HttpCli.GetAsync operation, how can I terminate it immedietly based on the contents on the header received, for example Content-Type? As soon as I get this header and see that it is not what I need, I want to cancel receiving the body. I am trying to download some images that may not be available and the web request returns status 200 every time and sends text/html when the URL is invalid. Also, if I use THttpCli components on a form and free that form will there be any problems if there is a .GetAsync operation still pending? I want to be able to close forms as quickly as possible when exiting my application. Thanks, Johnnie Norsworthy -- 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] UDP Socket Range Error
I got the following error report at one customer site which appears to be during the creation of my TDataModule the TWSocket resides on. exception class : ERangeError exception message : Range check error. Main ($fff9384b): 008d7c34 +064 REMINDER.EXE OverbyteIcsWndControl 525 +1 TIcsWndControl.Dispose 008d7e62 +022 REMINDER.EXE OverbyteIcsWndControl 550 +3 TIcsWndControl.Destroy 008ddb2d +0dd REMINDER.EXE OverbyteIcsWSocket4286 +31 TCustomWSocket.Destroy 008e4b8b +053 REMINDER.EXE OverbyteIcsWSocket7904 +11 TCustomLineWSocket.Destroy 0047717e +046 REMINDER.EXE Classes TComponent.DestroyComponents 00476f83 +047 REMINDER.EXE ClassesTComponent.Destroy 004781a5 +065 REMINDER.EXE ClassesTDataModule.Destroy 00404a56 +03e REMINDER.EXE System @ClassCreate 008e218f +0df REMINDER.EXE OverbyteIcsWSocket6893 +15 TCustomWSocket.SocketError 008e1b36 +0ca REMINDER.EXE OverbyteIcsWSocket6523 +34 TCustomWSocket.InternalClose 008e19e5 +011 REMINDER.EXE OverbyteIcsWSocket6440 +1 TCustomWSocket.Close 008ddaa2 +052 REMINDER.EXE OverbyteIcsWSocket4263 +8 TCustomWSocket.Destroy 008e4b8b +053 REMINDER.EXE OverbyteIcsWSocket7904 +11 TCustomLineWSocket.Destroy 004703e5 +0ad REMINDER.EXE ClassesCreateComponent My component settings are as follows: object WSocket: TWSocket LineMode = False LineLimit = 65536 LineEnd = #13#10 LineEcho = False LineEdit = False Addr = 'mydomain.com' -not the actual one I use Port = '12007' Proto = 'udp' LocalAddr = '0.0.0.0' LocalPort = '0' LastError = 0 MultiThreaded = False MultiCast = False MultiCastIpTTL = 1 ReuseAddr = False ComponentOptions = [wsoNoReceiveLoop] ListenBacklog = 5 ReqVerLow = 1 ReqVerHigh = 1 FlushTimeout = 60 SendFlags = wsSendNormal LingerOnOff = wsLingerOff LingerTimeout = 0 KeepAliveOnOff = wsKeepAliveOff KeepAliveTime = 0 KeepAliveInterval = 0 SocksLevel = '5' SocksAuthentication = socksNoAuthentication Left = 60 Top = 8 end What settings do I need to change? I am using the socket to send udp packets with some non-crucial logging of my application. I've only seen this error once, but my program is being installed all over right now with this code so I am a bit worried. -Johnnie Norsworthy -- 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] UDP Socket Range Error
On 8/2/06, Francois PIETTE [EMAIL PROTECTED] wrote: 008d7c34 +064 REMINDER.EXE OverbyteIcsWndControl 525 +1 TIcsWndControl.Dispose Can you point the exact source code ? It is likely that your line numbers doesn't match my line numbers. Show the offending line and a few before and after so that we can locate exactly which istruction trigger the range error. In my source code, line 525 is: OutputDebugString(PChar('Dispose ' + ClassName + ' ThreadID=' + IntToStr(GetCurrentThreadId))); It is possible that GetCurrentThreadId return an unsigned integer which could not fit into an integer required for IntToStr (an integer in the range 2G to 4G). You may simply remove that line since it is for debugging purpose, or fix it like this: Thanks for responding.. This is the same line I have. The problem is that same code is all over the place in the source. Is there another version of the source without those debug statements or with conditional compilation directives? I need the code for the UDP packet sending as bullet-proof as possible. Would you recommend programming it in something less powerful than ICS - possibly the standard Delphi sockets? I can't use Indy as it also cause some obscure error and I don't care to inconvenience the Indy people anymore. I am running the server here on on eo fmy machines with ICS code with no problems. The machine the error is happening on is a Windows 98SE machine and so far, it is just that one computer. -Johnnie -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] UDP Socket Range Error
I disabled range checking in the .INC file and rebuilt the package and it appears to be working for now. The conditional compilation for debug code will be welcomed. It seems to be an issue with Windows 98 machines from what I have seen. Thanks guys. -Johnnie Norsworthy -- 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] Converting from Indy - UDP Send - DNS caching
I am converting a small remote logging project from Indy to ICS that sends UDP packets. Following the example in UDPSend1.pas, I do the following when I wish to send my string: WSocket.Proto := 'udp'; WSocket.Addr := 'mydomain.com'; WSocket.Port := '12007'; WSocket.Connect; WSocket.SendStr('mystring'); in the WSocket.DataSent() event: WSocket.Close; What type of error conditions/exceptions might occur in the sending code that I need to watch for? Is there ever a situation when .Connect would fail due to an existing connection if sending a few packets in a short span? Do I need to add #13 #10 to strings before sending? Can I cache the domain lookup after sending the first packet to speed up the send process or is it helpful? If so, in what event do I grab the looked up IP Address and from what property? Thanks! I am looking forward to using ICS. -Johnnie -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Converting from Indy - UDP Send - DNS caching
On 8/1/06, Dan [EMAIL PROTECTED] wrote: Why not open the socket at the start, then just call WSocket.SendStr when you want to send something. I thought by leaving it open it might cause disconnection problems. Can I just leave it open all the time and call Send() as needed. It may be hours before it sends. I can just open and close it in my TDatamodule event code if that will work. Yes, you need to add #13#10 if your receiver needs it, calling SendStr does not add this for you. 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