VB.Net Tracing....
#1
Thread Starter
Scooby Regular
Joined: Nov 2001
Posts: 15,239
Likes: 1
From: Leeds - It was 562.4bhp@28psi on Optimax, How much closer to 600 with race fuel and a bigger turbo?
I have written a couple of services that run on one of our servers and I want to have a console app displaying the output / status of these... Can / should I use the trace function to do this?? or is this more for debugging purposes?
Anybody got any examples of how to do this? Preferably in Visual Basic .Net
David
Anybody got any examples of how to do this? Preferably in Visual Basic .Net
David
#3
Well you could go to the hassle of extending the Tracing stuff, but then you'd have to use remoting between apps
Couldn't you just have the service open a console window? (Will have to set the service to allow interaction with desktop)
Couldn't you just have the service open a console window? (Will have to set the service to allow interaction with desktop)
#4
Thread Starter
Scooby Regular
Joined: Nov 2001
Posts: 15,239
Likes: 1
From: Leeds - It was 562.4bhp@28psi on Optimax, How much closer to 600 with race fuel and a bigger turbo?
not really as I want to be able to open the window whenever... not just when the service starts..
David
David
#6
David,
No idea if this is of use, but I write a lot of services in Delphi. They have no interaction with the desktop at all (so users can't break them). But I also write a "control panel" for them that talks to the service via custom messages. In fact, the service also writes custom messages but if the "control panel" isn't running, nothing happens and the rest of the system ignores them. Works well in so much as if the "control panel" fails, gets knocked over etc. it doesn't take the service with it.
Wouldn't have a clue how to do this with .net, new fangled malarky
Cheers
Ian
No idea if this is of use, but I write a lot of services in Delphi. They have no interaction with the desktop at all (so users can't break them). But I also write a "control panel" for them that talks to the service via custom messages. In fact, the service also writes custom messages but if the "control panel" isn't running, nothing happens and the rest of the system ignores them. Works well in so much as if the "control panel" fails, gets knocked over etc. it doesn't take the service with it.
Wouldn't have a clue how to do this with .net, new fangled malarky
Cheers
Ian
#7
Thread Starter
Scooby Regular
Joined: Nov 2001
Posts: 15,239
Likes: 1
From: Leeds - It was 562.4bhp@28psi on Optimax, How much closer to 600 with race fuel and a bigger turbo?
That is exactly what I want to do... Can you give an example of how you do this in delphi, as I know people that do both languages.
Its not that I dont want the service to open a window or have a system tray icon, its just that a service should have no interaction with the desktop really... it should just sit there and run.. If I was going to do it these ways there would be no point in writing it as a service...
David
Its not that I dont want the service to open a window or have a system tray icon, its just that a service should have no interaction with the desktop really... it should just sit there and run.. If I was going to do it these ways there would be no point in writing it as a service...
David
Trending Topics
#10
Could write a tracing listener that writes to a log file?
EDIT: Or writes to the event log.
BTW : Remoting isn't difficult - if you want a walk down that path, I'll hold your hand
[Edited by MrDeference - 5/30/2002 11:24:41 AM]
EDIT: Or writes to the event log.
BTW : Remoting isn't difficult - if you want a walk down that path, I'll hold your hand
[Edited by MrDeference - 5/30/2002 11:24:41 AM]
#11
Thread Starter
Scooby Regular
Joined: Nov 2001
Posts: 15,239
Likes: 1
From: Leeds - It was 562.4bhp@28psi on Optimax, How much closer to 600 with race fuel and a bigger turbo?
They are written in VB.net as thats my language... (to some extent)... How does remoting work? is it like a message queue?? Ideally I dont want to write to a file and it allready writes to the event log, but the status msgs could be every min, so didnt want to write all to the event log, and then have the app read from the event log, with some sort of filter....
I also had a stupid idea of being able to monitor it from another machine, but that was just being stupid!
Mr deference if you could that would be good...
Email me offline if you prefer
David
edited to add .net and remove email add.
[Edited by David_Wallis - 5/30/2002 11:32:19 AM]
[Edited by David_Wallis - 5/30/2002 11:55:31 AM]
I also had a stupid idea of being able to monitor it from another machine, but that was just being stupid!
Mr deference if you could that would be good...
Email me offline if you prefer
David
edited to add .net and remove email add.
[Edited by David_Wallis - 5/30/2002 11:32:19 AM]
[Edited by David_Wallis - 5/30/2002 11:55:31 AM]
#14
Thread Starter
Scooby Regular
Joined: Nov 2001
Posts: 15,239
Likes: 1
From: Leeds - It was 562.4bhp@28psi on Optimax, How much closer to 600 with race fuel and a bigger turbo?
Yeah No probs.. I might be onto something at the moment... couldnt get it working today, think it might have been cos I was tired at work... going to give it my best shot tomorrow. Its annoying me...
Seems like as MrDeference said the way to do it is use remoting... This seems to talk across a tcp port... at the moment just pointing to localhost but this presents a lot better opportunities for me...
David
Seems like as MrDeference said the way to do it is use remoting... This seems to talk across a tcp port... at the moment just pointing to localhost but this presents a lot better opportunities for me...
David
#15
Don't forget about security - the tcp channel listens on all interfaces for the given port. If you want to lock this down, you'll need to add a channel sink. I still reckon you should have done it the easy way , good learning opportunity I guess though!
#17
David,
If you can get remoting working (I've never tried), that would give you better options with regards to having the 'console' on one machine and the service on another if I understand it correctly.
The method I use, is to broadcast messages within Windows after first registering a custom message. This will not work across a network as it uses the Windows message queue.
But I'll get something together for you next week anyway, you never know....
Cheers
Ian
If you can get remoting working (I've never tried), that would give you better options with regards to having the 'console' on one machine and the service on another if I understand it correctly.
The method I use, is to broadcast messages within Windows after first registering a custom message. This will not work across a network as it uses the Windows message queue.
But I'll get something together for you next week anyway, you never know....
Cheers
Ian
#19
David_Wallis: you don't *need* to sort out the security, but if you want to, I suggest you read up on adding a channel sink. What you do is effectively add an event handler to the chain on top of the remoting transport. You need to read up on remoting if you want to get it all to work
#20
Thread Starter
Scooby Regular
Joined: Nov 2001
Posts: 15,239
Likes: 1
From: Leeds - It was 562.4bhp@28psi on Optimax, How much closer to 600 with race fuel and a bigger turbo?
looking at how much progress I'm making at the moment (not much) I think I may have to buy a decent book.. or move towards using C# as this seems the favoured language for remoting.
David
David
#21
Another option I didn't think of...
Depending quite how much info you need, and the format of it, SysInternals may have what you need: http://www.sysinternals.com/ntw2k/fr...ebugview.shtml
Basically write a string to OutputDebugString (which is a basic API call). If nothing is there to hear it, nothing happens. However, if you fire this application up, setup filters and all the info. from your service will appear in this window.
I'd forgotten about this, but it is a tool I sometimes use for debugging stuff.
---------------------------------------------------------
The OutputDebugString function sends a string to the debugger for the current application.
VOID OutputDebugString(
LPCTSTR lpOutputString // pointer to string to be displayed
);
Parameters
lpOutputString
Points to the null-terminated string to be displayed.
Return Values
This function does not return a value.
---------------------------------------------------------
Looks as though this will work over a network too so might suit ozzy's problem as well. (I'll link in).
Cheers
Ian
[Edited by IWatkins - 5/31/2002 2:43:42 PM]
Depending quite how much info you need, and the format of it, SysInternals may have what you need: http://www.sysinternals.com/ntw2k/fr...ebugview.shtml
Basically write a string to OutputDebugString (which is a basic API call). If nothing is there to hear it, nothing happens. However, if you fire this application up, setup filters and all the info. from your service will appear in this window.
I'd forgotten about this, but it is a tool I sometimes use for debugging stuff.
---------------------------------------------------------
The OutputDebugString function sends a string to the debugger for the current application.
VOID OutputDebugString(
LPCTSTR lpOutputString // pointer to string to be displayed
);
Parameters
lpOutputString
Points to the null-terminated string to be displayed.
Return Values
This function does not return a value.
---------------------------------------------------------
Looks as though this will work over a network too so might suit ozzy's problem as well. (I'll link in).
Cheers
Ian
[Edited by IWatkins - 5/31/2002 2:43:42 PM]
#23
Thread Starter
Scooby Regular
Joined: Nov 2001
Posts: 15,239
Likes: 1
From: Leeds - It was 562.4bhp@28psi on Optimax, How much closer to 600 with race fuel and a bigger turbo?
the way I have got is working now... but I think there is something simple at fault... and with MrDeference's expert help Im sure ill get it sorted!
David
David
Thread
Thread Starter
Forum
Replies
Last Post
Dracoro
Computer & Technology Related
13
14 May 2008 08:05 PM
midget1500
Computer & Technology Related
8
01 March 2005 11:27 PM