[twsocket] Insert image into email body
Hello, I've a little problem when sending an e-mail with images. Ii'want create an e-mail with an image into the body of message, like thunderbird when you use menu insert - image. I've tried htmlsmtp.EmailImages.text with ContentType := smtpHtml, but when receive the message the image is an attachment. Anyone know how i can resolve this problem ? TIA P.s. sorry for my bad english, i hope that my problem is explained correctly. __ TISCALI ADSL 6 MEGA FLAT CON 3 MESI GRATIS! Con Tiscali Adsl 6 Mega Flat navighi con la SuperVelocita' a soli 29.95 euro al mese, senza limiti di tempo. E se attivi entro il 31 maggio, 3 MESI sono GRATIS! Scopri come risparmiare navigando veloce su http://abbonati.tiscali.it/adsl/sa/6flat_tc/ -- 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] [HELP]FTPServer within a service...
Hi everyone, i'm wondering about the way to implement a FTP server (with thread on GetProcessing) within a Windows Service ? Does anyone has a sample ? knowing that i'd like ot have a form with a memo for log messages... thanks a lot for your answer ! Guillaume MAISON - Guillaume MAISON - [EMAIL PROTECTED] 83, Cours Victor Hugo 47000 AGEN Tél : 05 53 87 91 48 - Fax : 05 53 68 73 50 e-mail : [EMAIL PROTECTED] - Web : http://nauteus.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] [HELP]FTPServer within a service...
Hello Guillaume, We have an implementation of ICS FTP server within a service however it has no service GUI as its GUI is made of another process that communicates with the engine through XML/HTTP. Take a look at http://www.fastream.net/netfileserver.htm and if you want to design something similar, I will be more than glad to answer your question(s). Best Regards, SubZero - Original Message - From: Guillaume MAISON [EMAIL PROTECTED] To: twsocket@elists.org Sent: Wednesday, May 18, 2005 4:01 PM Subject: [twsocket] [HELP]FTPServer within a service... Hi everyone, i'm wondering about the way to implement a FTP server (with thread on GetProcessing) within a Windows Service ? Does anyone has a sample ? knowing that i'd like ot have a form with a memo for log messages... thanks a lot for your answer ! Guillaume MAISON - Guillaume MAISON - [EMAIL PROTECTED] 83, Cours Victor Hugo 47000 AGEN Tl : 05 53 87 91 48 - Fax : 05 53 68 73 50 e-mail : [EMAIL PROTECTED] - Web : http://nauteus.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 -- 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] TFTPClient upload problem
From: Arno Garrels [EMAIL PROTECTED] Do you explicitly call TypeBinary/TypeBinaryAsync? It is not enough to set property Binary only. No, I don't. When and where should I call this? Woody (TMW) -- 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] [HELP]FTPServer within a service...
i'm wondering about the way to implement a FTP server (with thread on GetProcessing) within a Windows Service ? Any windows GUI application can be run as a service, provided it never asks for any input from the user. I use a very simple real service that runs the windows program, and sends it a message telling it to exit when the service is stopped. If the message is lost, it terminates the program. This makes debugging very easy, since you can have as many, buttons, labels and memos in the application as you like. 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
Re: [twsocket] TFTPClient upload problem
From: Arno Garrels [EMAIL PROTECTED] Woody (TMW) wrote: I am using the TFTPclient component in a small app I built for maintaining my web pages and files. For a long time, everything worked great. Well, I changed ISP's and so I had to move my web page over to the new location. Now, whenever I upload my zip files to the ftp directory, they seem to get corrupted. When I try to download the files for testing, Winzip reports that there are errors and that some bytes are missing. I thought this might be a problem between using ASCII and binary but I have the component set to binary. Do you explicitly call TypeBinary/TypeBinaryAsync? It is not enough to set property Binary only. Arno, I tried putting a call to TypeBinary just after filling in user,password and host name but before opening the connection and it didn't change anything. FTP1.UserName := edUser.Text; FTP1.Password := edPass.Text; FTP1.HostName := edURL.Text; FTP1.TypeBinary; FTP1.TypeSet; try FTP1.Connect; if FTP1.Connected then begin ... Woody (TMW) -- 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] [HELP]FTPServer within a service...
i'm wondering about the way to implement a FTP server (with thread on GetProcessing) within a Windows Service ? Any windows GUI application can be run as a service, provided it never asks for any input from the user. I use a very simple real service that runs the windows program, and sends it a message telling it to exit when the service is stopped. If the message is lost, it terminates the program. This makes debugging very easy, since you can have as many, buttons, labels and memos in the application as you like. Yes but i have noticed that if you use : - a service module - a Ftp server comp within the Service Datamodule - a window created at runtime and shown (to display log messages) there're some problems with the message pump process between the FtpServer's one and the Application's one(coming from Forms.pas). Particularly when you use a Thread within the GetProcessing event and that you delay the DoSendData... In this later case, the message to the server socket (to send data : WM_FTPSRV_START_SEND) is sent but never received, unless you can trigger the log window's message pump wich then transmit it to the socket. But if meanwhile the client has disconnected, then there's an exception... i don't know if i'm clear enough :| ! Guillaume MAISON - Guillaume MAISON - [EMAIL PROTECTED] 83, Cours Victor Hugo 47000 AGEN Tél : 05 53 87 91 48 - Fax : 05 53 68 73 50 e-mail : [EMAIL PROTECTED] - Web : http://nauteus.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] [HELP]FTPServer within a service...
Hello Guillaume, On my site you find a simple class to include in your GUI program so that the same EXE can run as normal GUI and also as NT service without any change. Advantage is that the service can make a tray icon when user log in, and if you click on it the service can popup his main form. Very easy for config and so :) With the ICS examples there is a lso a NT service demo. I think it is for WTSocketServer. --- Rgds, Wilfried http://www.mestdagh.biz Wednesday, May 18, 2005, 15:01, Guillaume MAISON wrote: Hi everyone, i'm wondering about the way to implement a FTP server (with thread on GetProcessing) within a Windows Service ? Does anyone has a sample ? knowing that i'd like ot have a form with a memo for log messages... thanks a lot for your answer ! Guillaume MAISON - Guillaume MAISON - [EMAIL PROTECTED] 83, Cours Victor Hugo 47000 AGEN Tél : 05 53 87 91 48 - Fax : 05 53 68 73 50 e-mail : [EMAIL PROTECTED] - Web : http://nauteus.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 -- 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] [HELP]FTPServer within a service...
Hello Guillaume, On my site you find a simple class to include in your GUI program so that the same EXE can run as normal GUI and also as NT service without any change. Advantage is that the service can make a tray icon when user log in, and if you click on it the service can popup his main form. Very easy for config and so :) i've downloaded it... and seen it... Well... i'll try it for one of my services (i have several)... i'll let you know ;) i'll see especially on the problem i've mentioned about message pump... Thanks a lot ! Guillaume MAISON - Guillaume MAISON - [EMAIL PROTECTED] 83, Cours Victor Hugo 47000 AGEN Tél : 05 53 87 91 48 - Fax : 05 53 68 73 50 e-mail : [EMAIL PROTECTED] - Web : http://nauteus.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] Receive result of the first ReceiveStr() call twice
Hello Francois and all, I'm using a TWSocket client in LineMode with LineEnd set to #13#10. I connect to a HTTP proxy server using CONNECT command. I then get a reply back from the HTTP proxy from ReceiveStr() Things look OK except that I am receiving the data from the first ReceiveStr() call twice. I get two WSocketDataAvailable messages for 3 lines in the HTTP response: Line 1: HTTP/1.0 200 Connection established Line 2: Proxy-agent: Proxy+ 3.00 Line 3: (Blank line) However, I'm getting the first ReceiveStr() result twice, see below: I'm getting HTTP/1.0 200 Connection established twice: 5/18/2005 2:36:43 PM WSocketDataAvailable idx=0 addr=127.0.0.1:4480 ErrCode=0 5/18/2005 2:36:43 PM HTTP/1.0 200 Connection established 5/18/2005 2:36:43 PM 5/18/2005 2:36:43 PM 5/18/2005 2:36:43 PM WSocketDataAvailable idx=0 addr=127.0.0.1:4480 ErrCode=0 5/18/2005 2:36:43 PM HTTP/1.0 200 Connection established Proxy-agent: Proxy+ 3.00 I then changed LineEnd to #13#10#13#10, I still get the result of the first ReceiveStr() twice, this time the result is two lines: HTTP/1.0 200 Connection established Proxy-agent: Proxy+ 3.00 (Blank line) 5/18/2005 2:40:11 PM WSocketDataAvailable idx=0 addr=127.0.0.1:4480 ErrCode=0 5/18/2005 2:40:11 PM HTTP/1.0 200 Connection established Proxy-agent: Proxy+ 3.00 5/18/2005 2:40:11 PM 5/18/2005 2:40:11 PM 5/18/2005 2:40:11 PM WSocketDataAvailable idx=0 addr=127.0.0.1:4480 ErrCode=0 5/18/2005 2:40:11 PM HTTP/1.0 200 Connection established Proxy-agent: Proxy+ 3.00 It seems that, somehow the first ReceiveStr() didn't remove the data from the buffer. Or am I missing anything? -- Best regards, Jack -- 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] Receive result of the first ReceiveStr() call twice
Hello Jack, Can you show your OnDataAvailable handler ? Eventually download SocketSpy from 'user made' page and 'hang' it between client and server. Then you see exacly what is sent by server. --- Rgds, Wilfried http://www.mestdagh.biz Wednesday, May 18, 2005, 20:48, Jack wrote: Hello Francois and all, I'm using a TWSocket client in LineMode with LineEnd set to #13#10. I connect to a HTTP proxy server using CONNECT command. I then get a reply back from the HTTP proxy from ReceiveStr() Things look OK except that I am receiving the data from the first ReceiveStr() call twice. I get two WSocketDataAvailable messages for 3 lines in the HTTP response: Line 1: HTTP/1.0 200 Connection established Line 2: Proxy-agent: Proxy+ 3.00 Line 3: (Blank line) However, I'm getting the first ReceiveStr() result twice, see below: I'm getting HTTP/1.0 200 Connection established twice: 5/18/2005 2:36:43 PM WSocketDataAvailable idx=0 addr=127.0.0.1:4480 ErrCode=0 5/18/2005 2:36:43 PM HTTP/1.0 200 Connection established 5/18/2005 2:36:43 PM 5/18/2005 2:36:43 PM 5/18/2005 2:36:43 PM WSocketDataAvailable idx=0 addr=127.0.0.1:4480 ErrCode=0 5/18/2005 2:36:43 PM HTTP/1.0 200 Connection established Proxy-agent: Proxy+ 3.00 I then changed LineEnd to #13#10#13#10, I still get the result of the first ReceiveStr() twice, this time the result is two lines: HTTP/1.0 200 Connection established Proxy-agent: Proxy+ 3.00 (Blank line) 5/18/2005 2:40:11 PM WSocketDataAvailable idx=0 addr=127.0.0.1:4480 ErrCode=0 5/18/2005 2:40:11 PM HTTP/1.0 200 Connection established Proxy-agent: Proxy+ 3.00 5/18/2005 2:40:11 PM 5/18/2005 2:40:11 PM 5/18/2005 2:40:11 PM WSocketDataAvailable idx=0 addr=127.0.0.1:4480 ErrCode=0 5/18/2005 2:40:11 PM HTTP/1.0 200 Connection established Proxy-agent: Proxy+ 3.00 It seems that, somehow the first ReceiveStr() didn't remove the data from the buffer. Or am I missing anything? -- Best regards, Jack -- 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] [HELP]FTPServer within a service...
Use a thread with his own message within your service to put all ICS stuff and you'll get rid of anything else. -- [EMAIL PROTECTED] http://www.overbyte.be - Original Message - From: Guillaume MAISON [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Wednesday, May 18, 2005 5:42 PM Subject: Re: [twsocket] [HELP]FTPServer within a service... i'm wondering about the way to implement a FTP server (with thread on GetProcessing) within a Windows Service ? Any windows GUI application can be run as a service, provided it never asks for any input from the user. I use a very simple real service that runs the windows program, and sends it a message telling it to exit when the service is stopped. If the message is lost, it terminates the program. This makes debugging very easy, since you can have as many, buttons, labels and memos in the application as you like. Yes but i have noticed that if you use : - a service module - a Ftp server comp within the Service Datamodule - a window created at runtime and shown (to display log messages) there're some problems with the message pump process between the FtpServer's one and the Application's one(coming from Forms.pas). Particularly when you use a Thread within the GetProcessing event and that you delay the DoSendData... In this later case, the message to the server socket (to send data : WM_FTPSRV_START_SEND) is sent but never received, unless you can trigger the log window's message pump wich then transmit it to the socket. But if meanwhile the client has disconnected, then there's an exception... i don't know if i'm clear enough :| ! Guillaume MAISON - Guillaume MAISON - [EMAIL PROTECTED] 83, Cours Victor Hugo 47000 AGEN Tél : 05 53 87 91 48 - Fax : 05 53 68 73 50 e-mail : [EMAIL PROTECTED] - Web : http://nauteus.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 -- 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] [HELP]FTPServer within a service...
i'm wondering about the way to implement a FTP server (with thread on GetProcessing) within a Windows Service ? Does anyone has a sample ? The is a sample service in the demos. There is nothing very special to make a service using ICS. As long as there is a working message pump, ICS component will work. For the GUI, you use another application, a GUI application that communicate with the service using ICS, probably using the HTTP server component which offer the eaisiest way to build an administrative interface without writing another application: you just use a browser to do the administration. -- 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
Re[2]: [twsocket] Receive result of the first ReceiveStr() call twice
Hello Francois, Thanks for the quick reply. No, I don't have any message handler of my own in my code. I create an object as the owner of an array of TWSocket objects. I assign the even handler of the TWSocket objects to a member function of that owner object and call ReceiveStr() in the OnDataAvailable handler. Any other reasons that you can think of that could cause this problem? My component verifies if a HTTP proxies supports CONNECT on port 443. I don't think HTTPCli component does what I want to do ... -- Best regards, Jack Wednesday, May 18, 2005, 3:59:06 PM, you wrote: FP Usually, when you receive the same data twice, it is because you called the FP message pump from one the ICS component event handler. Never call directly FP or indirectly ( ShowMessage, MessageBox,...) from an event handler that is FP called by hardware (a data packet comes from the network) unless you really FP know what you are doing. FP btw: Do not reinvent the wheel, use the HTTP component ! FP - Original Message - Hello Francois and all, I'm using a TWSocket client in LineMode with LineEnd set to #13#10. I connect to a HTTP proxy server using CONNECT command. I then get a reply back from the HTTP proxy from ReceiveStr() Things look OK except that I am receiving the data from the first ReceiveStr() call twice. I get two WSocketDataAvailable messages for 3 lines in the HTTP response: Line 1: HTTP/1.0 200 Connection established Line 2: Proxy-agent: Proxy+ 3.00 Line 3: (Blank line) However, I'm getting the first ReceiveStr() result twice, see below: I'm getting HTTP/1.0 200 Connection established twice: 5/18/2005 2:36:43 PM WSocketDataAvailable idx=0 addr=127.0.0.1:4480 FP ErrCode=0 5/18/2005 2:36:43 PM HTTP/1.0 200 Connection established 5/18/2005 2:36:43 PM 5/18/2005 2:36:43 PM 5/18/2005 2:36:43 PM WSocketDataAvailable idx=0 addr=127.0.0.1:4480 FP ErrCode=0 5/18/2005 2:36:43 PM HTTP/1.0 200 Connection established Proxy-agent: Proxy+ 3.00 I then changed LineEnd to #13#10#13#10, I still get the result of the first ReceiveStr() twice, this time the result is two lines: HTTP/1.0 200 Connection established Proxy-agent: Proxy+ 3.00 (Blank line) 5/18/2005 2:40:11 PM WSocketDataAvailable idx=0 addr=127.0.0.1:4480 FP ErrCode=0 5/18/2005 2:40:11 PM HTTP/1.0 200 Connection established Proxy-agent: Proxy+ 3.00 5/18/2005 2:40:11 PM 5/18/2005 2:40:11 PM 5/18/2005 2:40:11 PM WSocketDataAvailable idx=0 addr=127.0.0.1:4480 FP ErrCode=0 5/18/2005 2:40:11 PM HTTP/1.0 200 Connection established Proxy-agent: Proxy+ 3.00 It seems that, somehow the first ReceiveStr() didn't remove the data from the buffer. Or am I missing anything? -- 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[2]: [twsocket] Receive result of the first ReceiveStr() call twice
Hello Wilfried, Sure. Below is my event handler code. Hope I'm doing something wrong, otherwise, it's really strange. TProxyChecker is the owner object of the TProxySocket object array. TProxySocket is derived from TWSocket. procedure TProxyChecker.WSocketDataAvailable(Sender: TObject; ErrCode: Word); var s: String; begin if ErrCode = 0 then with TProxySocket(Sender) do begin s := ReceiveStr(); Log(s); Close(); end; end; The destination server is a commercial http proxy server. I tried using #13#10 and #13#10#13#10, I different strings read back from ReceiveStr. But the second string includes the first string in both cases. So it shouldn't be the server sending the string twice. BTW, I'm using the latest ICS. -- Best regards, Jack Wednesday, May 18, 2005, 3:31:32 PM, you wrote: WM Hello Jack, WM Can you show your OnDataAvailable handler ? WM Eventually download SocketSpy from 'user made' page and 'hang' it WM between client and server. Then you see exacly what is sent by server. WM --- WM Rgds, Wilfried WM http://www.mestdagh.biz WM Wednesday, May 18, 2005, 20:48, Jack wrote: Hello Francois and all, I'm using a TWSocket client in LineMode with LineEnd set to #13#10. I connect to a HTTP proxy server using CONNECT command. I then get a reply back from the HTTP proxy from ReceiveStr() Things look OK except that I am receiving the data from the first ReceiveStr() call twice. I get two WSocketDataAvailable messages for 3 lines in the HTTP response: Line 1: HTTP/1.0 200 Connection established Line 2: Proxy-agent: Proxy+ 3.00 Line 3: (Blank line) However, I'm getting the first ReceiveStr() result twice, see below: I'm getting HTTP/1.0 200 Connection established twice: 5/18/2005 2:36:43 PM WSocketDataAvailable idx=0 addr=127.0.0.1:4480 ErrCode=0 5/18/2005 2:36:43 PM HTTP/1.0 200 Connection established 5/18/2005 2:36:43 PM 5/18/2005 2:36:43 PM 5/18/2005 2:36:43 PM WSocketDataAvailable idx=0 addr=127.0.0.1:4480 ErrCode=0 5/18/2005 2:36:43 PM HTTP/1.0 200 Connection established Proxy-agent: Proxy+ 3.00 I then changed LineEnd to #13#10#13#10, I still get the result of the first ReceiveStr() twice, this time the result is two lines: HTTP/1.0 200 Connection established Proxy-agent: Proxy+ 3.00 (Blank line) 5/18/2005 2:40:11 PM WSocketDataAvailable idx=0 addr=127.0.0.1:4480 ErrCode=0 5/18/2005 2:40:11 PM HTTP/1.0 200 Connection established Proxy-agent: Proxy+ 3.00 5/18/2005 2:40:11 PM 5/18/2005 2:40:11 PM 5/18/2005 2:40:11 PM WSocketDataAvailable idx=0 addr=127.0.0.1:4480 ErrCode=0 5/18/2005 2:40:11 PM HTTP/1.0 200 Connection established Proxy-agent: Proxy+ 3.00 It seems that, somehow the first ReceiveStr() didn't remove the data from the buffer. Or am I missing anything? -- Best regards, Jack -- 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[2]: [twsocket] Threaded client?
Hello Francois, I'm not using a TDataModule but as I mentioned in my other email, I created an object to own the array of TWSocket objects. Now I have a new question that relates to the dependency of the main form. I'm reusing the sockets. So when a socket is disconnected, I assign a different IP and connect again. I understand that I can not do this in the OnSessionClosed event handler (or that didn't work.) Instead, I need to post a message to the main form, and reconnect in the windows message handler. This also introduces a dependency to the main form, and adds and some code in the main form unit. Is there any other way to defer the call to the Connect function so that it will happen after the code exits the OnSessionClosed event handler? I know I can create a hidden window in the owner object but I would avoid doing that if there is an easier way. -- Best regards, Jack The reason I was thinking of a multi-threaded client is that I want to isolate this module with the main form. FP No need to have multithread for that. Just put your TWSocket into a FP TDataModule. It's enough. FP You can evn create them dynamicall in a pure .pas unit. FP fyi: Message handlers can be put everywhere, it doesn't matter. FP - Original Message - Hello Francois and all, I saw a thread server sample in ICS package but did not see any sample for threaded client. I understand that with ICS I don't have to do multi-threading. The reason I was thinking of a multi-threaded client is that I want to isolate this module with the main form. The module is supposed to create multiple sockets to test a group of servers. I suppose this can be achieved with an array of wsocket objects in a single-threaded application but the socket will have to have something to do with the main form? For example, parent-ed by the main form, or the message handlers defined in the main form. (I could be wrong.) That's why I'm thinking of using a separate group of threads to do the server check. I wonder if there are samples for the client. -- Best regards, Jack -- 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