Click here to Skip to main content
15,893,722 members
Articles / Desktop Programming / MFC

A reusable, high performance, socket server class - Part 2

Rate me:
Please Sign up or sign in to vote.
4.70/5 (33 votes)
17 Aug 2002CPOL11 min read 976.1K   6K   192  
To maintain performance a socket server shouldn't make blocking calls from its IO threads. This article builds on the previous one to add a business logic thread pool to our example server.
Microsoft Visual Studio Solution File, Format Version 7.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SimpleProtocolServer2", "SimpleProtocolServer2.vcproj", "{F72CE7DD-82B9-418A-A97F-D68BDA32855D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Win32Tools", "..\JetByteTools\Win32Tools\Win32Tools.vcproj", "{4AB42A6F-2448-4F6C-8F32-4785795E8F01}"
EndProject
Global
	GlobalSection(SourceCodeControl) = preSolution
		SccNumberOfProjects = 3
		SccProjectUniqueName0 = SimpleProtocolServer2.vcproj
		SccLocalPath0 = .
		CanCheckoutShared = false
		SccProjectUniqueName1 = ..\\JetByteTools\\Win32Tools\\Win32Tools.vcproj
		SccLocalPath1 = .
		CanCheckoutShared = false
		SccProjectFilePathRelativizedFromConnection1 = ..\\JetByteTools\\Win32Tools\\
		SccProjectName2 = \u0022$/Web\u0020Articles/SocketServers/SimpleProtocolServer2/SimpleProtocolServer2\u0022,\u0020WKAAAAAA
		SccLocalPath2 = .
		SccProvider2 = MSSCCI:Microsoft\u0020Visual\u0020SourceSafe
		CanCheckoutShared = false
		SolutionUniqueID = {882629D9-7F24-4132-BD8A-3B4E84E8EB7D}
	EndGlobalSection
	GlobalSection(SolutionConfiguration) = preSolution
		ConfigName.0 = Debug
		ConfigName.1 = Release
		ConfigName.2 = Unicode Debug
		ConfigName.3 = Unicode Release
	EndGlobalSection
	GlobalSection(ProjectDependencies) = postSolution
		{F72CE7DD-82B9-418A-A97F-D68BDA32855D}.0 = {4AB42A6F-2448-4F6C-8F32-4785795E8F01}
	EndGlobalSection
	GlobalSection(ProjectConfiguration) = postSolution
		{F72CE7DD-82B9-418A-A97F-D68BDA32855D}.Debug.ActiveCfg = Debug|Win32
		{F72CE7DD-82B9-418A-A97F-D68BDA32855D}.Debug.Build.0 = Debug|Win32
		{F72CE7DD-82B9-418A-A97F-D68BDA32855D}.Release.ActiveCfg = Release|Win32
		{F72CE7DD-82B9-418A-A97F-D68BDA32855D}.Release.Build.0 = Release|Win32
		{F72CE7DD-82B9-418A-A97F-D68BDA32855D}.Unicode Debug.ActiveCfg = Unicode Debug|Win32
		{F72CE7DD-82B9-418A-A97F-D68BDA32855D}.Unicode Debug.Build.0 = Unicode Debug|Win32
		{F72CE7DD-82B9-418A-A97F-D68BDA32855D}.Unicode Release.ActiveCfg = Unicode Release|Win32
		{F72CE7DD-82B9-418A-A97F-D68BDA32855D}.Unicode Release.Build.0 = Unicode Release|Win32
		{4AB42A6F-2448-4F6C-8F32-4785795E8F01}.Debug.ActiveCfg = Debug|Win32
		{4AB42A6F-2448-4F6C-8F32-4785795E8F01}.Debug.Build.0 = Debug|Win32
		{4AB42A6F-2448-4F6C-8F32-4785795E8F01}.Release.ActiveCfg = Release|Win32
		{4AB42A6F-2448-4F6C-8F32-4785795E8F01}.Release.Build.0 = Release|Win32
		{4AB42A6F-2448-4F6C-8F32-4785795E8F01}.Unicode Debug.ActiveCfg = Unicode Debug|Win32
		{4AB42A6F-2448-4F6C-8F32-4785795E8F01}.Unicode Debug.Build.0 = Unicode Debug|Win32
		{4AB42A6F-2448-4F6C-8F32-4785795E8F01}.Unicode Release.ActiveCfg = Unicode Release|Win32
		{4AB42A6F-2448-4F6C-8F32-4785795E8F01}.Unicode Release.Build.0 = Unicode Release|Win32
	EndGlobalSection
	GlobalSection(ExtensibilityGlobals) = postSolution
	EndGlobalSection
	GlobalSection(ExtensibilityAddIns) = postSolution
	EndGlobalSection
EndGlobal

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) JetByte Limited
United Kingdom United Kingdom
Len has been programming for over 30 years, having first started with a Sinclair ZX-80. Now he runs his own consulting company, JetByte Limited and has a technical blog here.

JetByte provides contract programming and consultancy services. We can provide experience in COM, Corba, C++, Windows NT and UNIX. Our speciality is the design and implementation of systems but we are happy to work with you throughout the entire project life-cycle. We are happy to quote for fixed price work, or, if required, can work for an hourly rate.

We are based in London, England, but, thanks to the Internet, we can work 'virtually' anywhere...

Please note that many of the articles here may have updated code available on Len's blog and that the IOCP socket server framework is also available in a licensed, much improved and fully supported version, see here for details.

Comments and Discussions