Re: [twsocket] OnDataAvailable and Reetrancy
> I don't call processmessages and the like directly in the event but > might output some lines on screen for debugging. Could the VCL maybe > call getmessage etc. behind my back in this scenario? You can safely add a line to a memo. You can't display a dialog box or a modal form. You can detect reentrancy in OnDataAvailable using a global variable. And you can see where the reentrancy come from using the debugger and his call stack display. 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: "Markus Humm" <[EMAIL PROTECTED]> To: Sent: Friday, September 01, 2006 7:25 AM Subject: [twsocket] OnDataAvailable and Reetrancy > > Can OnDataAvailable be called while it is > > > already running? > > > And if yes, how to prevent this? Is using critical > > > sections a good idea here? > > > You must avoid having the events reentered. To avoid this, you simply > > have > > to _not_ call any form of the message pump from the events. The > > message pump > > is ProcessMessages, any modal form, GetMessage/DispatchMessage and the > > likes. > > I don't call processmessages and the like directly in the event but > might output some lines on screen for debugging. Could the VCL maybe > call getmessage etc. behind my back in this scenario? > > Other thing: what about critical sections. Would they be safe for > preventing this in my situation? > > Greetings > > Markus > -- > 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 and Reetrancy
Markus Humm wrote: > I don't call processmessages and the like directly in the event but > might output some lines on screen for debugging. How? ShowMessage is a modal form. > > Other thing: what about critical sections. Would they be safe for > preventing this in my situation? No, critical sections would be working only when they are used from multiple threads. You could try something like below, is the exception raised? var AFlag:Boolean procedure TForm.WSocketDataAvailable(Sender: TObject; ErrCode: Word); begin if AFlag then raise Exception.Create('reentered'); AFlag := TRUE; try [..] finally AFlag : FALSE end; end; --- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html > Greetings > > Markus -- 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] OnDataAvailable and Reetrancy
> Can OnDataAvailable be called while it is > > already running? > > And if yes, how to prevent this? Is using critical > > sections a good idea here? > You must avoid having the events reentered. To avoid this, you simply > have > to _not_ call any form of the message pump from the events. The > message pump > is ProcessMessages, any modal form, GetMessage/DispatchMessage and the > likes. I don't call processmessages and the like directly in the event but might output some lines on screen for debugging. Could the VCL maybe call getmessage etc. behind my back in this scenario? Other thing: what about critical sections. Would they be safe for preventing this in my situation? Greetings Markus -- 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] FTP resuming transfers
>> Do you mean it could be smaller than his previous size >> when resuming a transfert ? > > Yes, that's what I mean and the question :)) If a resumed transfer is smaller than the existing file, then there is a problem ! It is likely that the start of the local file is no more the same as the copy on the server and the whole transfert is corrupted. -- [EMAIL PROTECTED] The author for 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" Sent: Thursday, August 31, 2006 9:18 PM Subject: Re: [twsocket] FTP resuming transfers > Francois PIETTE wrote: >>> I reworked the streams stuff in both FTP C/S today and >>> fixed some bugs, everything was tested sucessfully with >>> 64-bit streams. There's only one question I cannot answer >>> by myself. >>> TFileStream in mode fmOpenWrite does not set its size >>> to current position when it is destroyed. Won't it make >>> sense to set stream size explizitely to the current position >>> in the FtpCli/FtpSrv when data connection is closed >>> (although I guess that it won't work in D2 since method >>> Size exists since D3)? >>> >>> What do you think? >> >> Do you mean it could be smaller than his previous size >> when resuming a transfert ? > > Yes, that's what I mean and the question :)) > >> I don't think so. >> >> -- >> 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 -- 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] Where is best to ask general Delphi questions?
Francois, Thanks. I'll take a look. ...Andy Francois PIETTE wrote: >> The Delphi and Delphi-Talk elists seem rather quiet. > > Delphi mailing list is still a very good place. A lot of users are still > subscribers and wake up when needed. > Forget about Delphi-Talk which is unmoderated. > >> Where is the best place to ask general Delphi questions - along the >> lines of who has used a good SVG component etc? > > Try one of the news://news.borland.com newsgroups if you don't get correct > answer in delphi mailing list. > > -- > Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html > -- > [EMAIL PROTECTED] > http://www.overbyte.be > > -- ASA Micros Ltd. 141 Wardle Road, Wardle, Rochdale. OL12 9JA UK Tel: +44(0)1706 355057 Company No. 4722262 VAT No. 704044772 -- 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] FTP resuming transfers
Francois PIETTE wrote: >> I reworked the streams stuff in both FTP C/S today and >> fixed some bugs, everything was tested sucessfully with >> 64-bit streams. There's only one question I cannot answer >> by myself. >> TFileStream in mode fmOpenWrite does not set its size >> to current position when it is destroyed. Won't it make >> sense to set stream size explizitely to the current position >> in the FtpCli/FtpSrv when data connection is closed >> (although I guess that it won't work in D2 since method >> Size exists since D3)? >> >> What do you think? > > Do you mean it could be smaller than his previous size > when resuming a transfert ? Yes, that's what I mean and the question :)) > I don't think so. > > -- > 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: [twsocket] Where is best to ask general Delphi questions?
> The Delphi and Delphi-Talk elists seem rather quiet. Delphi mailing list is still a very good place. A lot of users are still subscribers and wake up when needed. Forget about Delphi-Talk which is unmoderated. > Where is the best place to ask general Delphi questions - along the > lines of who has used a good SVG component etc? Try one of the news://news.borland.com newsgroups if you don't get correct answer in delphi mailing list. -- 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] Where is best to ask general Delphi questions?
Hi, The Delphi and Delphi-Talk elists seem rather quiet. Where is the best place to ask general Delphi questions - along the lines of who has used a good SVG component etc? Regards, Andy -- ASA Micros Ltd. 141 Wardle Road, Wardle, Rochdale. OL12 9JA UK Tel: +44(0)1706 355057 Company No. 4722262 VAT No. 704044772 -- 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] FTP resuming transfers
> I reworked the streams stuff in both FTP C/S today and > fixed some bugs, everything was tested sucessfully with > 64-bit streams. There's only one question I cannot answer > by myself. > TFileStream in mode fmOpenWrite does not set its size > to current position when it is destroyed. Won't it make > sense to set stream size explizitely to the current position > in the FtpCli/FtpSrv when data connection is closed > (although I guess that it won't work in D2 since method > Size exists since D3)? > > What do you think? I think that I don't undestand why you have to set the size of the TFileStream when it is destroyed. Do you mean it could be smaller than his previous size when resuming a transfert ? I don't think so. -- 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: [twsocket] OnDataAvailable and reetrancy
> Can OnDataAvailable be called while it is > already running? > And if yes, how to prevent this? Is using critical > sections a good idea here? You must avoid having the events reentered. To avoid this, you simply have to _not_ call any form of the message pump from the events. The message pump is ProcessMessages, any modal form, GetMessage/DispatchMessage and the likes. -- Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] http://www.overbyte.be - Original Message - From: "Markus Humm" <[EMAIL PROTECTED]> To: Sent: Thursday, August 31, 2006 8:20 PM Subject: [twsocket] OnDataAvailable and reetrancy > Hello, > > I've a server and a client app. which communicate through a TCP based > protocoll I designed. > > The server get's requests which in OnDataAvailable are received into a > 1500 Byte sized array (most time the app. will run on a LAN) whose > contents is copied into a larger buffer then since the request could be > fragmented. > > The larger buffer is processed within the context of OnDataAvailable. > If I send requests manually via clicking on a button in the client all > works well, but not if the client sends say 1.000 requests in a loop. > > The server gets out of sync then because the buffer contains garbage > now. But where does it come? Can OnDataAvailable be called while it is > already running? And if yes, how to prevent this? Is using critical > sections a good idea here? > > The processing of the larger puffer is to check validity of the request > and extract the real request out of my data format. The real request is > appended to a queue then which gets processed by a seperate thread. > > Greetings > > Markus > -- > 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] FTP resuming transfers
Yes, I believe you can safely set the Size property manually as a workaround. That's what I do! Regards, Sz - Original Message - From: "Arno Garrels" <[EMAIL PROTECTED]> To: "ICS support mailing" Sent: Thursday, August 31, 2006 9:37 PM Subject: Re: [twsocket] FTP resuming transfers : Fastream Technologies wrote: : > AFAIK, ICS v6 is only for D/BCB6+ and ICSv5 is going to get : > abondoned. So no need to worry! :)) : : Have you really read my question?? : : > : > Best Regards, : > : > SZ : > : > - Original Message - : > From: "Arno Garrels" <[EMAIL PROTECTED]> : > To: "ICS support mailing" : > Sent: Thursday, August 31, 2006 9:27 PM : > Subject: [twsocket] FTP resuming transfers : > : > : >> Hello, : >> : >> I reworked the streams stuff in both FTP C/S today and : >> fixed some bugs, everything was tested sucessfully with : >> 64-bit streams. There's only one question I cannot answer : >> by myself. : >> TFileStream in mode fmOpenWrite does not set its size : >> to current position when it is destroyed. Won't it make : >> sense to set stream size explizitely to the current position : >> in the FtpCli/FtpSrv when data connection is closed : >> (although I guess that it won't work in D2 since method : >> Size exists since D3)? : >> : >> What do you think? : >> : >> --- : >> Arno Garrels [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 -- 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] FTP resuming transfers
Fastream Technologies wrote: > AFAIK, ICS v6 is only for D/BCB6+ and ICSv5 is going to get > abondoned. So no need to worry! :)) Have you really read my question?? > > Best Regards, > > SZ > > - Original Message - > From: "Arno Garrels" <[EMAIL PROTECTED]> > To: "ICS support mailing" > Sent: Thursday, August 31, 2006 9:27 PM > Subject: [twsocket] FTP resuming transfers > > >> Hello, >> >> I reworked the streams stuff in both FTP C/S today and >> fixed some bugs, everything was tested sucessfully with >> 64-bit streams. There's only one question I cannot answer >> by myself. >> TFileStream in mode fmOpenWrite does not set its size >> to current position when it is destroyed. Won't it make >> sense to set stream size explizitely to the current position >> in the FtpCli/FtpSrv when data connection is closed >> (although I guess that it won't work in D2 since method >> Size exists since D3)? >> >> What do you think? >> >> --- >> Arno Garrels [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] FTP resuming transfers
AFAIK, ICS v6 is only for D/BCB6+ and ICSv5 is going to get abondoned. So no need to worry! :)) Best Regards, SZ - Original Message - From: "Arno Garrels" <[EMAIL PROTECTED]> To: "ICS support mailing" Sent: Thursday, August 31, 2006 9:27 PM Subject: [twsocket] FTP resuming transfers : Hello, : : I reworked the streams stuff in both FTP C/S today and : fixed some bugs, everything was tested sucessfully with : 64-bit streams. There's only one question I cannot answer : by myself. : TFileStream in mode fmOpenWrite does not set its size : to current position when it is destroyed. Won't it make : sense to set stream size explizitely to the current position : in the FtpCli/FtpSrv when data connection is closed : (although I guess that it won't work in D2 since method : Size exists since D3)? : : What do you think? : : --- : Arno Garrels [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
[twsocket] FTP resuming transfers
Hello, I reworked the streams stuff in both FTP C/S today and fixed some bugs, everything was tested sucessfully with 64-bit streams. There's only one question I cannot answer by myself. TFileStream in mode fmOpenWrite does not set its size to current position when it is destroyed. Won't it make sense to set stream size explizitely to the current position in the FtpCli/FtpSrv when data connection is closed (although I guess that it won't work in D2 since method Size exists since D3)? What do you think? --- Arno Garrels [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
[twsocket] OnDataAvailable and reetrancy
Hello, I've a server and a client app. which communicate through a TCP based protocoll I designed. The server get's requests which in OnDataAvailable are received into a 1500 Byte sized array (most time the app. will run on a LAN) whose contents is copied into a larger buffer then since the request could be fragmented. The larger buffer is processed within the context of OnDataAvailable. If I send requests manually via clicking on a button in the client all works well, but not if the client sends say 1.000 requests in a loop. The server gets out of sync then because the buffer contains garbage now. But where does it come? Can OnDataAvailable be called while it is already running? And if yes, how to prevent this? Is using critical sections a good idea here? The processing of the larger puffer is to check validity of the request and extract the real request out of my data format. The real request is appended to a queue then which gets processed by a seperate thread. Greetings Markus -- 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
lalin ha scritto: > Hello, > I use SMTPClient for sending a email since a server with default smtp > server of IIS. The example program find this smtp server. But in my program, > with this code: > Smtp1.Host := smtpserver; > Smtp1.port := 'smpt'; > Smtp1.FromName := name; > Smtp1.HdrFrom := mail1; > Smtp1.HdrTo:= mail2; > Smtp1.HdrSubject := title; > Smtp1.Connect; > Smtp1.Data; > Smtp1.quit; > > produces "SMTP component not ready". Can you help me? If you want to keep this code structure, use SMTPSync component and check return for each step. By the way, consider to switch to event driven architecture for best performance and better structure. Regards -- Marcello Vezzelli Software Development Department E-Works s.r.l. tel. +39 059 2929081 fax +39 059 2925035 Direzionale 70 - Via Giardini 456/c 41100 Modena - 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] SMTPClient
Hi Carlos, Is the "Smtp1.port := 'smpt';" an error in your code or a typo? It should be "Smtp1.port := 'smtp';" Regards, Bevan lalin wrote: > Hello, > I use SMTPClient for sending a email since a server with default smtp > server of IIS. The example program find this smtp server. But in my program, > with this code: > Smtp1.Host := smtpserver; > Smtp1.port := 'smpt'; > Smtp1.FromName := name; > Smtp1.HdrFrom := mail1; > Smtp1.HdrTo:= mail2; > Smtp1.HdrSubject := title; > Smtp1.Connect; > Smtp1.Data; > Smtp1.quit; > > produces "SMTP component not ready". Can you help me? > > Regards. > Carlos. -- 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] SMTPClient
Hello, I use SMTPClient for sending a email since a server with default smtp server of IIS. The example program find this smtp server. But in my program, with this code: Smtp1.Host := smtpserver; Smtp1.port := 'smpt'; Smtp1.FromName := name; Smtp1.HdrFrom := mail1; Smtp1.HdrTo:= mail2; Smtp1.HdrSubject := title; Smtp1.Connect; Smtp1.Data; Smtp1.quit; produces "SMTP component not ready". Can you help me? Regards. Carlos. -- 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