Re: [twsocket] Architectural question II
Why not have a single thread responsible for doing that and then just have the TTimers use PostThreadMessage to request the update? Markus Humm wrote: Hello, regarding my question from last weekend only a part was answered so far. The thing is now: if several TTimers get fired at the same time and all of them want to write into a shared TStringList-Type buffer (okay, it's in a wrapper class), how to make sure only one at a time gets acces and doesn't mess up the thing? because the critical section will only guard this against the thread which reads out the entries and afterwards deletes them. So what to do here? 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] Help in understanding Web Service
Hi Mike, I have a need to create a Web Server to answer requests from web browsers. So I have tried the WebServ example but I am not sure how to send requests to it. Here is what I tried; 1- Ran the application on my windows XP machine and when I tried to start the service on port 80 I received an exception stating the address is already in use. (10048 error) So you have a web server running on your machine already - probably Personal Web Server, or something like that. 2- So I tried a different port (6080) and the service started ok. 3- So now from Internet Explorer I tried to connect to the service with the following http://pavallion8000/webserv:6280/ and I received a web page stating ; Forbidden You don´t have permission to access /webserv:6280/ on this server. I think you want http://localhost:6080 or http://pavallion8000:6080 Regards, Bevan -- 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] WinSock error 10035 with TWSocketServer
Hi Dan, TWSocketClient* Client = dynamic_castTWSocketClient*(Sender); AnsiString msg = Client-ReceiveStr(); The first line will execute, I think the second line will generate an exception here. I´m not sure. Did you have it into an exception block ? As far as I know the dynamic_cast is a kind of equivalent for ´is´ or ´as´ operators in Delphi and some other languages. It is not the same as a type cast. I even think it will evaluate to false (null) because Sender is of type TObject (yeah it is TWSocketClient, but compiler dont know that). A dynamic cast is safer. Yes its similar to Delphi´s as/is operators. In this case, this a pointer dynamic cast (rather than a reference), it will return null/nil if Sender isn´t really a TWSocketClient, and the code should then check for this. An alternative is to use a reference: TWSocketClient Client = dynamic_castTWSocketClient(Sender); But Sender is a pointer - I didn't think you could typecast a pointer to a reference. Regards, Bevan -- 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] Need a simple SMTP example
Hi Michael, Sorry, I sent my previous reply directly to you instead of to the list. thanks for the hint, I already looked into the code and - by the way - I find it very well structured. However, one question is left. There´s always spoken about using async components, but in my special case isn´t it easier to use the respective sync component? In this case I think you're right, and I've been known to do that in the past as well - saves having to worry about implementing timeouts because I believe there's a timeout parameter for the Sync versions of the functions. It is quite simple: I´m opening a query on a database, iterating through the result set and have to send one mail for each record (= customer). I can´t advance to the next record until the mail has been delivered, so a sync component would be (possibly?) preferrable. And as far as I´m understanding it, I can concatenate the sync commands rather than advancing to the next command in OnRequestDone - am I right here? Yes, that's right, you can just run one command after the other, possibly with appropriate error checking as well. Regards, Bevan Edwards -- 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] WinSock error 10035 with TWSocketServer
Hi Wilfried, It is normal that you receive an empty string once a while. Just exit the OnDataAvailable event in that case. When data is really ready to receive OnDataAvailable will fire again. I see your point - the other day I got the same result over and over again, today the same code works fine. I'll have to remember to build retry functionality into the system :) BTW, just to clarify what was happening the other day, the following result would end up with the variable 'msg' having data: void __fastcall MyClass::ClientDataAvailable(TObject *Sender, WORD ErrCode) { AnsiString msg = ((TWSocketClient*) Sender)-ReceiveStr(); } Whereas this code would result in the variable msg being empty: void __fastcall MyClass::ClientDataAvailable(TObject *Sender, WORD ErrCode) { TWSocketClient* Client = dynamic_castTWSocketClient*(Sender); AnsiString msg = Client-ReceiveStr(); } Regards, Bevan -- 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] WinSock error 10035 with TWSocketServer
Hi all, I am using BDS2006 to write a service application that creates a TWSocketServer and waits for connections. When a connection is made, the client sends requests and the service processes the requests and returns the results. This is all being done with LineMode enabled. I've written a similar module in another application recently and that went without a hitch. In this particular case (using code copied from the other application), in OnDataAvailable for the TWSocketClient I type cast the Sender to a TWSocketClient and then call ReceiveStr to retrieve the data. This was resulting in an empty string, despite the fact that by inspecting the object I could see there is data in the receive buffer. Further investigation/testing has revealed that I'm getting error 10035 (operation would block) and wondered why this would happen now and not previously. The only thing I can think of that I'm doing different is that the testing is being done on one machine, whereas I don't think I did that previously. However, I have tested this application with the client on another machine and it exhibits the same problem. Another thing I noticed is that if I do: AnsiString msg = ((TWSocketClient*)Sender)-ReceiveStr(); at the start of the OnDataAvailable event, then I get the data coming through. But I believe (based on the existing application that works) that I should be able to typecast the Sender variable first. Does anyone have any suggestions about what might be going wrong here? Regards, Bevan Edwards -- 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
Re: [twsocket] BCB2006 Console mode application requires CONTROLS.OBJ
Hi all, I just thought I'd mention that I solved my problem (see below). It appears that, by default, when creating a console application that uses the VCL, BDS2006 puts vcl and rtl into the packages section of the .bdsproj file, but not in the libraries section. So I ended up setting the following in the .bdsproj file: property category=build.node name=libraries value=vcl.lib rtl.lib IcsDel100.lib/ Regards, Bevan Bevan Edwards wrote: Hi all, I was hoping someone here may be able to help me with this. I have created a console mode application and turned off Build with Runtime packages - a sample of code exhibiting the problem is shown below. When I attempt to build this project, I get an error stating [Linker Fatal Error] Fatal: Unable to open file 'CONTROLS.OBJ'. In my BDS lib directory I have a CONTROLS.DCU file, but not CONTROLS.OBJ file. If I build with Build with Runtime packages turned on, then I don't get the problem. Can anybody tell me which file I need to link in to get rid of this message? --snip-- #include vcl.h #pragma hdrstop #include smtpprot.hpp #pragma package(smart_init) #pragma link SmtpProt //--- #pragma argsused int main(int argc, char* argv[]) { TSyncSmtpCli* cliSmtp = new TSyncSmtpCli(NULL); cliSmtp-FromName = [EMAIL PROTECTED]; cliSmtp-HdrFrom = [EMAIL PROTECTED]; cliSmtp-RcptName-Clear(); cliSmtp-RcptName-Add([EMAIL PROTECTED]); cliSmtp-HdrTo = [EMAIL PROTECTED]; cliSmtp-HdrSubject = Test Message; cliSmtp-MailMessage-Text = This is a test message; cliSmtp-Host = smtp.mydomain.com; cliSmtp-ConnectSync(); cliSmtp-HeloSync(); cliSmtp-MailFromSync(); cliSmtp-RcptToSync(); cliSmtp-DataSync(); delete cliSmtp; cliSmtp = NULL; return 0; } --snip-- Regards, Bevan -- 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] BCB2006 Console mode application requires CONTROLS.OBJ
Hi all, I was hoping someone here may be able to help me with this. I have created a console mode application and turned off Build with Runtime packages - a sample of code exhibiting the problem is shown below. When I attempt to build this project, I get an error stating [Linker Fatal Error] Fatal: Unable to open file 'CONTROLS.OBJ'. In my BDS lib directory I have a CONTROLS.DCU file, but not CONTROLS.OBJ file. If I build with Build with Runtime packages turned on, then I don't get the problem. Can anybody tell me which file I need to link in to get rid of this message? --snip-- #include vcl.h #pragma hdrstop #include smtpprot.hpp #pragma package(smart_init) #pragma link SmtpProt //--- #pragma argsused int main(int argc, char* argv[]) { TSyncSmtpCli* cliSmtp = new TSyncSmtpCli(NULL); cliSmtp-FromName = [EMAIL PROTECTED]; cliSmtp-HdrFrom = [EMAIL PROTECTED]; cliSmtp-RcptName-Clear(); cliSmtp-RcptName-Add([EMAIL PROTECTED]); cliSmtp-HdrTo = [EMAIL PROTECTED]; cliSmtp-HdrSubject = Test Message; cliSmtp-MailMessage-Text = This is a test message; cliSmtp-Host = smtp.mydomain.com; cliSmtp-ConnectSync(); cliSmtp-HeloSync(); cliSmtp-MailFromSync(); cliSmtp-RcptToSync(); cliSmtp-DataSync(); delete cliSmtp; cliSmtp = NULL; return 0; } --snip-- Regards, Bevan -- 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] RE : RE : RE : THttpCli in TDatamodule (Console program)
Hi, Yves Palma wrote: In fact I have an AV with any ICS component (if I create a new TForm project and add a Tping component and then run the program, I get the AV) The AV is in rtl100.bpl I have solved my problem. I need to unselect 'build with packages' on my Project Options / Packages. I don't have any AV (Access Violation) and everything is ok. (THttpcli work fine on my datamodule) In that case, the problem was probably caused by the fact that the application either couldn't find the appropriate .BPL file, or the one it found was the wrong version. You could try building with build with packages turned on and put the ICS BPL file into the same directory as your executable. Regards, Bevan -- 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] NOFORMS with ICS v5 TTnCnx class
Hi all, I was compiling ICS v5 with NOFORMS defined and found that the TTnCnx class is not properly setup for this - it uses WSocket.AllocateHWND and WSocket.DeallocateHWnd. I have corrected it by copying the appropriate code from another component, but thought that Francois my like to fix the original source files. Regards, Bevan -- 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] NOFORMS with ICS v5 TTnCnx class
Hi Francois, I have sent the file directly to your e-mail address, rather than the list. Regards, Bevan Francois PIETTE wrote: I was compiling ICS v5 with NOFORMS defined and found that the TTnCnx class is not properly setup for this - it uses WSocket.AllocateHWND and WSocket.DeallocateHWnd. I have corrected it by copying the appropriate code from another component, but thought that Francois my like to fix the original source files. It will be faster that you email your updated file since you seems to have done the work ! -- 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] Compiling ICSBCB100 project for ICS v5
Hi all, As someone earlier indicated, I built the ICSDel100 project and then turned on Generate All C++Builder files option, which seems to have worked alright. However, if I try to build the ICSBCB100 project, it gives me errors about mssing .OBJ files. The first is ICSLOGGER.OBJ, which I found in the output from the ICSDEL100 project, so I just used that. But the next is ICMP.OBJ, which doesn't appear to be anywhere. Has anyone had any success building this project? Do we need to build this project? Regards, Bevan -- 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] Compiling ICSBCB100 project for ICS v5
Hi Francois, Francois PIETTE wrote: As someone earlier indicated, I built the ICSDel100 project and then turned on Generate All C++Builder files option, which seems to have worked alright. However, if I try to build the ICSBCB100 project, it gives me errors about mssing .OBJ files. The first is ICSLOGGER.OBJ, which I found in the output from the ICSDEL100 project, so I just used that. But the next is ICMP.OBJ, which doesn't appear to be anywhere. The compiler should compile IcsLogger.pas and Icmp.pas (provided) to create the corresponding .obj files. I don't know why they are not compiled. Are the files listed in the project ? No, neither of them are listed in the project. But then I noticed that ICMP is not listed in the ICSDel100 project either. Regards, Bevan -- 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] Compiling ICSBCB100 project for ICS v5
Hi Arno, As someone earlier indicated, I built the ICSDel100 project and then turned on Generate All C++Builder files option, which seems to have worked alright. However, if I try to build the ICSBCB100 project, it gives me errors about mssing .OBJ files. The first is ICSLOGGER.OBJ, which I found in the output from the ICSDEL100 project, so I just used that. But the next is ICMP.OBJ, which doesn't appear to be anywhere. Has anyone had any success building this project? Do we need to build this project? AFAIK if you built the Delphi package with option Generate All C++Builder files you should not try to build ICSBCB100 as well. Components will be available on the palette in both BCB and Delphi personality as well. That's at least what I found thru trial and error. Yes, the components are available for C++Builder projects, so I'll just skip building the ICSBCB100 package. The only problem I found was that the Generate All C++Builder files option didn't create the *.OBJ files, but Generate C++ object files did, so that's alright. I usually build my applications with Packages and Dynamic RTL turned off, so that's why I needed the *.OBJ files. Regards, Bevan -- 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] NOFORMS with ICS v5 TTnCnx class
Hi Francois, Francois PIETTE wrote: I have sent the file directly to your e-mail address, rather than the list. Looking at the change you've made, I see that you have not the latest ICS (beta) version. In the latest beta version, Arno Garrels already made those changes ! In the history, it is dated march 11th. I downloaded and used the ICS v5 from your web site - that indicates that it's from 09/03/06. Where I can download the most recent version from? Regards, Bevan -- 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] Any BCB users out there?
Hi Arno, I followed your instructions for installing ICS v6 (see below), but when I compile a project with a single HttpCli component on it, I get Declaration terminated incorrectly and Multiple declaration for u_long errors from the OverbyteIcsWinsock.hpp file. You mentioned that you compiled such a project without any problems. How did you get rid of these messages? Regards, Bevan Arno Garrels wrote: Arno Garrels wrote: Fastream Technologies wrote: I use BCB6 and BDS2006, but I haven't yet ventured down the path of installing any of the latest releases. However, it's something I'm considering doing within the next month or so (depending on availability of my time). I think you might face the same problems that I face when you upgrade to the latest version. Using BDS2006, I built the Delphi package, then in the Linker options I checked Generate All C++Builder Files and rebuilt all. That way the ICS components become available on the Tool Palette in both personalities. I dropped a THttpCli on a form of a newly created BCB VCL project and compiled it w/o any problem. Forgot to say that if you use above methode the BCB-BDS2006 demo projects complain that IcsBcb100.lib cannot be found. I had to remove that reference manually from the project files. --- 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
Re: [twsocket] Any BCB users out there?
Oh, I might switch to v5 then ;) Arno Garrels wrote: Bevan Edwards wrote: Hi Arno, I followed your instructions for installing ICS v6 (see below), but when I compile a project with a single HttpCli component on it, I get Declaration terminated incorrectly and Multiple declaration for u_long errors from the OverbyteIcsWinsock.hpp file. You mentioned that you compiled such a project without any problems. How did you get rid of these messages? I was talking about V5, I've not yet installed V6. --- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html Regards, Bevan Arno Garrels wrote: Arno Garrels wrote: Fastream Technologies wrote: I use BCB6 and BDS2006, but I haven't yet ventured down the path of installing any of the latest releases. However, it's something I'm considering doing within the next month or so (depending on availability of my time). I think you might face the same problems that I face when you upgrade to the latest version. Using BDS2006, I built the Delphi package, then in the Linker options I checked Generate All C++Builder Files and rebuilt all. That way the ICS components become available on the Tool Palette in both personalities. I dropped a THttpCli on a form of a newly created BCB VCL project and compiled it w/o any problem. Forgot to say that if you use above methode the BCB-BDS2006 demo projects complain that IcsBcb100.lib cannot be found. I had to remove that reference manually from the project files. --- 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
Re: [twsocket] Any BCB users out there?
Oh, I might switch to v5 then ;) The only reason why I'm still on V5 is not enough time :( If you don't need to instanciate thousands of ICS objects you can sure use V5 until V6 fully supports BCB2006. However it would be nice if you were able to fix it. Time is a bit of a factor for me too, but now I have both ICS v5 and ICS v6 packages built in BDS2006 (but only ICS v5 installed) and I can swap between them reasonably easily. So as I get a chance, I'll look into the ICS v6 problem further. Bevan -- 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] Any BCB users out there?
Hiya, Fastream Technologies wrote: The problem in v6 under C++ is OverbyteIcsTypes defines the Windows constants once again for just clarity reasons under Delphi and this annoys the C++ compiler. From a quick look, isn't the problem simply that WINSOCK2.H declares these using #define's, while the OverbyteIcs*.hpp declares them as static const? Would it be feasible to have a #define that caused these static const definitions not to be made? Or is the problem more complex than that? Regards, Bevan -- 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] Any BCB users out there?
Hi all, As far as I can remember, we are not the only BCB users here on this list. Could you confirm that you are as well using BCB and how do you install and use the latest versions on your C++ compiler? I use BCB6 and BDS2006, but I haven't yet ventured down the path of installing any of the latest releases. However, it's something I'm considering doing within the next month or so (depending on availability of my time). Regards, Bevan -- 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] SmtpCli problem with OnAttachContentType
Hi Arno, I have just discovered a problem with the OnAttachContentType implementation in TSmtpCli and TSyncSmtpCli. When this property is assigned, as soon as InitUUEncode is called within TriggerGetData, the assignment to FOnAttachContentType is lost. Try current ICS release, SmtpProt.pas has been updated/changed/fixed since that time when InitUUEncode was renamed. Thanks for that, it worked perfectly! :) Regards, Bevan Edwards -- 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