M
Matthew Speed
(About me: I know very little about writing server applications. I
have done plenty of VB6 desktop app work but this is my first server
program. I got it to work by modifying examples. I understand what
it is doing but not much about what is involved in extending it. )
I am not necessarily looking for code examples here, just some
pointers as to what direction I need to proceed to resolve these
things.
I have written a multithreaded TCP/IP server. This program's job is
to listen to requests from a Java program running on some wireless
phones. On the server side it interacts with SQL Server 2000. It
accepts connections, is passed login credentials, recieves some data
update from the client and sends back some results. The program
itself works fine. I am now trying to improve upon it and have run
into the following issues/problems:
1. I want this to run as a Windows service a la SMTP. When it runs as
an interactive program it consumes 5-8% of the CPU time. When it runs
as a service it consumes all it can get. When it runs it is ALWAYS
the top CPU user on the machine. I like to think that when clients
aren't connected it shouldn't be using 90% of the CPU time.
2. I would like to be able to monitor what it is doing. When I ran
it as a console app I could write out messages to the console telling
me how many clients were connected and what they were sending or being
sent. I would like to wite a monitor program that can tap into the
service that can receive the equivalent messages to be displayed in a
text window since services don't get to talk to the console. My first
thoughts would be to try to treat it like a COM object and raise
events but I don't know if that model works in VB.Net or with services
in general.
3. I would like to be able to log each clients' conversation to a
text file for review. I created a logfile class with open,write and
close methods that creates/opens a log file. This works fine in the
console app but the service app seems unable to do this. Do services
have the ability to write to the filesystem?
TIA
have done plenty of VB6 desktop app work but this is my first server
program. I got it to work by modifying examples. I understand what
it is doing but not much about what is involved in extending it. )
I am not necessarily looking for code examples here, just some
pointers as to what direction I need to proceed to resolve these
things.
I have written a multithreaded TCP/IP server. This program's job is
to listen to requests from a Java program running on some wireless
phones. On the server side it interacts with SQL Server 2000. It
accepts connections, is passed login credentials, recieves some data
update from the client and sends back some results. The program
itself works fine. I am now trying to improve upon it and have run
into the following issues/problems:
1. I want this to run as a Windows service a la SMTP. When it runs as
an interactive program it consumes 5-8% of the CPU time. When it runs
as a service it consumes all it can get. When it runs it is ALWAYS
the top CPU user on the machine. I like to think that when clients
aren't connected it shouldn't be using 90% of the CPU time.
2. I would like to be able to monitor what it is doing. When I ran
it as a console app I could write out messages to the console telling
me how many clients were connected and what they were sending or being
sent. I would like to wite a monitor program that can tap into the
service that can receive the equivalent messages to be displayed in a
text window since services don't get to talk to the console. My first
thoughts would be to try to treat it like a COM object and raise
events but I don't know if that model works in VB.Net or with services
in general.
3. I would like to be able to log each clients' conversation to a
text file for review. I created a logfile class with open,write and
close methods that creates/opens a log file. This works fine in the
console app but the service app seems unable to do this. Do services
have the ability to write to the filesystem?
TIA