473,385 Members | 1,400 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

TCP/IP server - Windows Service vs. application

Hi,
I'm working with a TCP/IP server (Mixed C/C++, built with VC++ .NET
2002) that can be run as either an application or as a Windows Service.
The problem we are facing is that when running as an application, the
server can handle 15+ connection attempts at relatively the same time.
When the program is run as a Service, however, it can't seem to handle
more than 4 at a time...We end up having to throttle the incoming
connections in order to have them all accepted properly.

My basic question is this: Is there any reason (typical Windows
2000/XP/2003 behavior, registry settings, etc) that a server program
should perform so differently when running as a Windows Service as
compared to when running as a normal application?

listen() is being passed SOMAXCONN as it's second argument, and after
accept() is called, only a few (small) memory allocations are performed
before passing the socket off to handler thread.

Any advice or ideas would be appreciated...

Thanks,
Josh

Nov 16 '05 #1
3 6026
"Josh Salit" <js****@slunk.net> wrote in message
news:#l**************@TK2MSFTNGP11.phx.gbl...
My basic question is this: Is there any reason (typical Windows
2000/XP/2003 behavior, registry settings, etc) that a server program
should perform so differently when running as a Windows Service as
compared to when running as a normal application?


I can't think of one.

Are you running the tests on the same box? I ask because 4 is close to 5 <g>
and 5 is (I think) the maximum number of simultaneous connections allowed by
some NT licenses.

Regards,
Will
Nov 16 '05 #2
William DePalo [MVP VC++ ] wrote:
I can't think of one.

Are you running the tests on the same box? I ask because 4 is close to 5 <g>
and 5 is (I think) the maximum number of simultaneous connections allowed by
some NT licenses.


Will,
Yes, the tests are run on the same box. The only limit I know of is the
backlog implemented by listen(), which I believe is limited to 5, but
that begs the question of why should the program's speed in accepting
the connections and passing them off to a handler thread differ when
running as a Service compared to as an application?

thanks,
Josh

Nov 16 '05 #3
"Josh Salit" <js****@slunk.net> wrote in message
news:ex**************@TK2MSFTNGP11.phx.gbl...
but
that begs the question of why should the program's speed in accepting
the connections and passing them off to a handler thread differ when
running as a Service compared to as an application?


Right. That's the question. :-)

Seriously, I can see how initialization and termination could be different,
but once the service gets going, it should be executing the same code as in
the console application case. What _is_ different is the runtime
environment: a different user context, a different desktop etc

This article is provides a good overview of the kinds of things that can
bite you in a service:

http://www.microsoft.com/msj/0398/service2.aspx

Perhaps it will help.

Regards,
Will
Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Keith | last post by:
All, I have been told this is an ASP.NET issue and not an IIS issue, so I am posting this here. I have a problem with ASP.NET returning an HTTP 500 error when trying to run ASPX pages on...
5
by: pberna | last post by:
Dear all, I built a Web Form application to start and stop a Windows Service remotely. I successful tested the application on Windows 2000 server + IIS. I must include the ASPNET user to the...
2
by: pvl | last post by:
Hi We have the following scenario: 1. SQL server 2000 on Windows 2003 Server 2. Web server 1, running web service 1 on Windows 2003 Server 3. Web server 2, running web service 2 on Windows 2000...
5
by: Matthew Speed | last post by:
(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...
4
by: Andy Baker | last post by:
I have an Windows forms application written in VB.NET that uses a SQL Server 2000 back end database with Windows authentication. There is no problem accessing the database from my application, or...
62
by: Bryan Dickerson | last post by:
Is there a way, with VS 2005 and FX 2.0, to read a given inbox? I need to write a 'monitor' program and my boss is convinced, as is always his first gut reaction, that we need to go buy a...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
2
by: Wimpie van Lingen | last post by:
Hey I have some more questions with regards to Remoting in .NET 2. I'm using TCP with the Binary formatter. My solution consists of 4 projects: - Class Library containing the server classes...
3
by: Lee T. Hawkins | last post by:
I am having a number of problems over the last two full days trying to get an ASP.NET 2.0 application to connect to a SQL Server 2005 database... First off, I built this application w/ Visual...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.