Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Saturday, November 11, 2006 12:59:36 AM(UTC)

snt  
snt

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.

 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Sunday, November 12, 2006 12:45:46 AM(UTC)

Bashar  
Guest

Groups: Guests
Posts: 3,040

Was thanked: 1 time(s) in 1 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:35:49 PM(UTC)

snt  
snt

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 5:01:28 AM(UTC)

Bashar  
Guest

Groups: Guests
Posts: 3,040

Was thanked: 1 time(s) in 1 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:55:01 PM(UTC)

snt  
snt

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:47:28 AM(UTC)

Bashar  
Guest

Groups: Guests
Posts: 3,040

Was thanked: 1 time(s) in 1 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:33:13 AM(UTC)
Formative

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:27:23 AM(UTC)

saumin  
saumin

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:29:20 AM(UTC)

saumin  
saumin

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:08:31 AM(UTC)

Travis  
Travis

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
LEAD Logo
 
#11 Posted : Thursday, May 3, 2007 10:49:26 AM(UTC)

Travis  
Travis

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.
File Attachment(s):
NET - V15 - SCP as Service.zip (69kb) downloaded 33 time(s).
Travis Montgomery
Senior Sales Engineer
LEAD Logo
 
#12 Posted : Thursday, May 17, 2007 3:06:43 AM(UTC)
Koos van Staden

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:34:31 AM(UTC)
Koos van Staden

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:11:34 AM(UTC)
Koos van Staden

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:35:35 AM(UTC)

Travis  
Travis

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.
File Attachment(s):
MyService.zip (3kb) downloaded 34 time(s).
Travis Montgomery
Senior Sales Engineer
LEAD Logo
 
#16 Posted : Friday, September 28, 2007 6:05:39 AM(UTC)

Otis  
Guest

Groups: Guests
Posts: 3,040

Was thanked: 1 time(s) in 1 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.
File Attachment(s):
NET - V15 - SCP as Service.zip (65kb) downloaded 39 time(s).
 
#17 Posted : Wednesday, June 15, 2011 3:46:47 AM(UTC)

Travis  
Travis

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.
File Attachment(s):
Service with MessagePump.zip (13kb) downloaded 39 time(s).
Travis Montgomery
Senior Sales Engineer
LEAD Logo
 
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.

Powered by YAF.NET | YAF.NET © 2003-2020, Yet Another Forum.NET
This page was generated in 0.339 seconds.