This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Saturday, November 11, 2006 12:54:36 AM(UTC)
Groups: Registered
Posts: 4
hi,
we have a SCP server application which works fine (our SCP
is a specialization of LDicomNet class). Now, when we tried making use of the
same class in a windows service application, no callbacks are triggered (we hav
our overrides). All the pre conditions for Listen() are met and Listen()
returns DICOM_SUCCESS. A call to IsActivated() returns true after the listen().
Are there any issues for LDicomNet being used in a service?
The flow of our service –
On start{
Start timer 05 secs
}
On timer’s elapse{
Init LEAD support
Startup
Scp-> listen
/// call to scp->IsActivated() returns true here}
OnStop{
/// call to scp->IsActivated() returns true here too
/// Clean up
}
Any help appreciated.
Thanks.
#2
Posted
:
Sunday, November 12, 2006 12:40:46 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
What callbacks are you overriding and do not work? I understand
that all the callbacks are fired in the Windows application. Is
that correct?
#3
Posted
:
Sunday, November 12, 2006 7:30:49 PM(UTC)
Groups: Registered
Posts: 4
the overridden callbacks -
OnAccept
OnReceiveAssociateRequest
OnReceiveCStoreRequest
OnReceiveReleaseRequest
OnClose
Listen returns DICOM_SUCCESS
IsActivated returns true
On SCU trying to connect, the OnAccept is not fired.
its true that all the callbcaks are fired in the application, but NOT in the service (i use the same SCP specialization).
#4
Posted
:
Monday, November 13, 2006 4:56:28 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
Please check the value of IsConnected right after the client connects
to the server. I am working on a similar issue in another thread
and in this one, IsConnected is False after the connection is made.
#5
Posted
:
Tuesday, November 14, 2006 9:50:01 PM(UTC)
Groups: Registered
Posts: 4
after the call to connect(), OnConnect() of the Client is triggered and here, IsConnected() returns true, while running the SCP as a service as well as an application.
likewise IsActivated() returns true in the SCP aft the call to Listen().
cud u plz point out how LDicomNet implements the callbacks?
- using events? or virtual functions? or C style function ptrs? or mapping MACROs? or any other tricks?
i believe, the default implementation (LDicomNet's) of OnAccept() accepts all connection requests. this should be true b'cz all connection requests are accepted (even in the service!!). is OnReceiveAssociateReq() [and the rest of the callbacks too] a do nothing by default? IMHO it must be, thats the reason my code breaks [assoc req time out], b'cz no virtual (overridden) methods are dispatched dynamically.
also, pls note that my service is derived from the (.NET) managed class ServiceBase, but all the LDicom** specs are unmanaged c++ classes.
#6
Posted
:
Thursday, November 16, 2006 4:42:28 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
I do not have any information about how the callbacks are internally
implemented. Can you please post a small test projects (not your
full project) for an SCP and SCU that show the problem? I know
this might not be easy to do, but if there is a problem in the toolkit,
then this is the only way to track it down.
#7
Posted
:
Friday, February 9, 2007 3:28:13 AM(UTC)
Groups: Registered
Posts: 5
Hello,
Was a solution ever provided to the issue presented at the start of this post? I am experiencing the same issue. My SCP application works fine when hosted in a Windows Forms application. However, when I move the code into a Windows Service the events/callbacks (i.e. OnAccept) are never triggered.
Thank you in advance,
Andrew
#8
Posted
:
Wednesday, March 28, 2007 6:22:23 AM(UTC)
Groups: Registered
Posts: 6
Hello,
We are also facing the same scenario.
Is this resolved? Please respond.
Thanks
Saumin
#9
Posted
:
Wednesday, March 28, 2007 6:24:20 AM(UTC)
Groups: Registered
Posts: 6
Hello!
Is this resolved yet? we are also facing the same problem. Please respond.
Thanks,
Saumin
#10
Posted
:
Friday, March 30, 2007 10:03:31 AM(UTC)
Groups: Registered, Tech Support
Posts: 207
Was thanked: 3 time(s) in 3 post(s)
Hello All,
I was able to duplicate this issue and have submitted this to our engineers. I will post again when I hear back from them.
Travis Montgomery
Senior Sales Engineer
#11
Posted
:
Thursday, May 3, 2007 10:44:26 AM(UTC)
Groups: Registered, Tech Support
Posts: 207
Was thanked: 3 time(s) in 3 post(s)
We have resolved the issue with receiving events inside a Windows Service.
Internally the LEADTOOLS DICOM DLL uses Window's Messages to communicate with Window's Sockets. So you must have a Message Pump so the messages can get processed. In your worker thread simply add a message pump after calling Listen.
The attached demo simply shows one method of implementing this. I'll give a brief walkthrough: We spawn a worker thread in the OnStart event. In the worker thread we create an instance of our Scp Class and call Listen. Following this call we created a function called WaitForComplete. This function has a message pump in it and also checks to see if want the loop to exit. In the Windows Service OnStop event we signal for the WaitForComplete function to exit so the child thread can clean up and exit.
Again this is one implementation. Feel free to develop your own just keep in mind that a message pump must exist in the thread the Listen is in.
The code also creates an EventLog so you can see when the OnAccept function is called.
Travis Montgomery
Senior Sales Engineer
#12
Posted
:
Thursday, May 17, 2007 3:01:43 AM(UTC)
Groups: Registered
Posts: 4
I find exactly the same behaviour when using the Multimedia Library to convert from .avi to .asf in a Windows Service. As soon as I set the .TargetFile property, it just goes off and does absolutely nothing. (Never executes the next line of code nor does it throw an exception)
#13
Posted
:
Thursday, May 17, 2007 3:29:31 AM(UTC)
Groups: Registered
Posts: 4
Adnan,
I'm trying to convert from .avi to .asf, using ltmmConvert, in a Windows Service (VB.Net) but, as soon as I set the .TargetFile property, it just goes off
and does absolutely nothing. (Never executes the next line of code nor
does it throw an exception).
It works perfectly in a Windows Forms application, but no luck in a Windows Service.
#14
Posted
:
Friday, May 18, 2007 4:06:34 AM(UTC)
Groups: Registered
Posts: 4
I'm experiencing something similar when using the Multimedia Library to convert from AVI to ASF with the convert class inside a Windows Service.
Is there any way you can show me how to implement a similar message pump in VB.Net?
#15
Posted
:
Friday, May 18, 2007 6:30:35 AM(UTC)
Groups: Registered, Tech Support
Posts: 207
Was thanked: 3 time(s) in 3 post(s)
This is really not anything that is LEAD specific, however, I will help you out here.
Attached is code in C# and VB.NET. It is the basic concept of having a message pump in your service. As you'll see there is no LEADTOOLS code involved.
Travis Montgomery
Senior Sales Engineer
#16
Posted
:
Friday, September 28, 2007 6:00:39 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
I have attached the same project using Getmessage instead of PeakMessage for the message pump. This is a much better solution for performance and keeps the CPU utilization down.
#17
Posted
:
Wednesday, June 15, 2011 3:41:47 AM(UTC)
Groups: Registered, Tech Support
Posts: 207
Was thanked: 3 time(s) in 3 post(s)
Also, here is a project to go with the C# version.
Travis Montgomery
Senior Sales Engineer
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.