Has anyone tried this for a laugh ??
Has anyone tried this for a laugh ??
Go to: http://docwiki.embarcadero.com/RADStudio/XE8/en/Service_Applications
Now try to re-create their example:
To create the example:
1. Choose File > New > Other and select Service Application from the New Items dialog box. The Service1 window appears.
2. From the Internet category of the Tool palette, add a ServerSocket component to the service window (Service1).
3. Add a private data member of type TMemoryStream to the TService1 class. The interface section of your unit should now look like this:
I failed at 2. as I cannot find the ServerSocket on the Internet category ( or any other category ). Am I missing something ?? Or is the documentation wrong ?
http://docwiki.embarcadero.com/RADStudio/XE8/en/Service_Applications
Go to: http://docwiki.embarcadero.com/RADStudio/XE8/en/Service_Applications
Now try to re-create their example:
To create the example:
1. Choose File > New > Other and select Service Application from the New Items dialog box. The Service1 window appears.
2. From the Internet category of the Tool palette, add a ServerSocket component to the service window (Service1).
3. Add a private data member of type TMemoryStream to the TService1 class. The interface section of your unit should now look like this:
I failed at 2. as I cannot find the ServerSocket on the Internet category ( or any other category ). Am I missing something ?? Or is the documentation wrong ?
http://docwiki.embarcadero.com/RADStudio/XE8/en/Service_Applications
You need to do the following and install dclsockets220.bpl as a new package, that is where you will find TServerSocket and TClientSocket components.
ReplyDeleteFrom the Delphi IDE menu select Component
Install Packages,
Click Add, in the Install Packages dialog,
Locate your Rad Studio \ XX.X \ Bin and select dclsockets220.bpl
Click open / Ok, you are done.
TServerSocket and TClientSocket will be listed listed in the Internet category of the Tool
The package is in C:\Program Files (x86)\Embarcadero\Studio\16.0\bin for XE8 or 15.0 \ bin for XE7 depending on what you are using, just locate dclsockets220.bpl and install it as the package.
ReplyDeleteRichard Baroniunas Thank you Richard I will try that in the morning !
ReplyDeleteYes, but these are older, deprecated socket components we really don't recommend using...
ReplyDeleteThe problem is with the documentation that is out of date on EMB http://docwiki.embarcadero.com/RADStudio/XE8/en/Service_Applications.
ReplyDeleteI would gather folks should Indy TIdTCPServer TIdTCPClient, is that correct ?
Yes; I think the Indy stuff is not tied to the Windows/PC way of doing things and I think that is why it's deprecated and Indy isn't. Is that correct Marco ?
ReplyDeleteThey've been deprecated for quite some time. Hopefully they won't get dropped as I'll have a load of rewriting to do.
ReplyDeleteWhile I've moved all new work to more modern components, TServerSocket and TClientSocket are still easy to use and pretty reliable (in my experience).
Vince Bartlett I agree, the Indy stuff can sometime be a pain to setup and it's very unforgiving if you don't get it quite right ... TClientSocket and TServerSocket on the other hand are a doddle to use .... If you are only ever writing for Windows platforms for the application we are doing .... then why not ? Please please please Embarcadero don't dump them !!
ReplyDeleteTony Danby Vince Bartlett either way the dclsockets220.bpl is there for usage and it does work, i create a simple application that communites from a server to a client so I guess as long as EMB puts it in directory they are still helping legacy users.
ReplyDeleteI would imagine way down the line they will drop it but folks can always petition them to put it up free somewhere on the community.
I would suggest that if your plans are to use this type of feature in the future there may be some TMS Components or others that are solid replacements.
One last thing is that the DOC Wiki needs to be updated if the components are deemed to be removed, makes sense doesn't it ?
Richard Baroniunas I guess we'll cross that bridge when it happens, until then we will act like ostriches and stick our heads in the sand ;-) ha ha
ReplyDeleteRichard Baroniunas Thanks for all your help mate !
ReplyDeleteTony Danby I agree with you if I can still use it and it works why not!
ReplyDeleteTony Danby Same thing goes when companies tell me about Pascal being an old programming language !
ReplyDeleteRichard Baroniunas Yes; I don't know how many times I heard that one. I am lucky the company I work for doesn't think like that. However, there are still a few C# coders around me who think they know "better" ... Unfortunately for them I can hold my own and give back as good as I get .... ;-)
ReplyDeleteTony Danby Good luck with the Service Application, what exactly are you looking to do ?
ReplyDeleteRichard Baroniunas What I need to do is not rocket science. My service will open one or more connections to a SQL Server database(s) and will read a table and use the data in there to send emails from a TTimer on the datamodule ( once a second ). I have essentially already done it, as I have an application version working beautifully and I wrote this with a Service in mind, so it has the concept of a database controller and Start, Stop. So all I did was use this code; shove a Service control class in between my stuff and the Service main and use the Service main to start and stop via the service control. It should have been a walk in the park .... instead it's been nightmare on elm street ....
ReplyDeleteTony Danby that sounds pretty cool, what are you using to connect to SQL FireDac ? Now I would assume that you would open up the connection, execute the query to retrieve the emails, process whatever you need done and then close the connection. If I have the time I am going to try and replicate that to see if I can crack to get it done and see what the side effects are.
ReplyDeleteRichard Baroniunas Actually it's not retrieving emails, it's sending them. On my Datamodule is a TTimer set to 1000ms, so every second it checks the table to see if there is anything to send; otherwise it waits until the next interval and so forth. It can be sat there for hours with nothing to do, then all of a sudden it will get 200 emails or more to send. As for the FireDAC, I wish !! ;-) This project was inherited from a Delphi 5 project and the source code heavily modifed. so it uses TADOConnection and so on ... but as soon as I get a moment free, I intent to have some play time with FireDAC and then may well go round retro fitting it .... depending on my findings !
ReplyDeleteAlso, when I send an email, via IdSMTP + IdMessage it is on it's own TThread, so when I send each email it is on a separate thread and that thread terminates and destroys it own objects after the send but it can still be in receipt of error messages, as it's only the IdMessage and the send that is threaded.
Tony Danby Yeows! Delphi 5 and it was converted over to XE8, still works, that is impressive regardless of band-aids. On the bright side at least you aren't using the BDE :)
ReplyDeleteRichard Baroniunas ;-) So True. I hated the BDE even when it was new
ReplyDelete! ( showing my age now ). The project has had about a 50% code re-write and I did warn managers that would be the case. I think it sank in a bit more when I said "What do you expect, you have effectively skipped 13 versions of Delphi and are expecting it to work. That's a tad unrealistic !"