Click here to Skip to main content
13,294,840 members (64,183 online)
Click here to Skip to main content
Add your own
alternative version


56 bookmarked
Posted 13 Nov 2002

Creating a Client/Server Framework

, 13 Nov 2002
Rate this:
Please Sign up or sign in to vote.
Create a complete client/server framework with added server features, including activity logging, minimizing to the system tray, password and version checking, as well as user maintenance.

Sample Image - ClientServer.jpg


In creating my own multiplayer game played over the Internet, I first had to create a client/server framework so that players could interact with each other. After I finished creating the game, I generalized this framework for others to use.

Client/Server framework

For those not familiar with how a client/server framework works, one server sits on a computer somewhere out on the Internet, waiting for clients to connect. When clients successfully connect and log on to this server, they send messages to other clients via the server. This framework may be used for various applications, such as a chat application, a multiplayer game, or any application where clients need to communicate with each other.

Creating the Client/Server framework

The program that I have created includes some added features that I believe most people running this would benefit from. From incorporating Chris Maunder and Warren Young's work, you have the option of the server minimizing to the system tray, so that it is out of the way. To fully benefit from this feature, you may want to create a shortcut to the server's executable, and have this shortcut minimize on startup. Also, by using Adam Clauss's inifile class, you have the option of forcing users to log on with a password. Note that if you use this option, you must create a procedure for people to create a new account and password, as this is not included. If different versions of your program are not compatible with each other, you may force users to all upgrade to the latest version using this framework. Finally, you may easily set how many days between logons must pass before a user is deleted from the user file.

If you are going to use this as a basis for your app, I recommend that you create a new project for the client program; then copy and paste the code. This is so that you may choose the name of the application yourself, as well as whether it's dialog-based or not. However, you don't have to recreate the server; users will never actually see this program.

One last thing to note is that the computer that runs the server must accept TCP connections on the port number that you run your application on. Therefore, make sure this rule is created on your firewall if you are running one. Also, the default IP address of the client program is, which translates to the local computer. Therefore, to connect client programs to the server residing on different computers, you must specify the server's actual IP address (type ipconfig at the server computer's command Prompt to find out its IP address).

Good luck, and I hope that I have provided you with a head start to creating your client/server application!


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Jeff Miles
Canada Canada
No Biography provided

You may also be interested in...


Comments and Discussions

QuestionUpdate? Pin
LordHogFred1-Dec-09 1:46
memberLordHogFred1-Dec-09 1:46 
Generalclass CSystemTray Pin
Em_Bang_Lang7-Jan-06 7:33
memberEm_Bang_Lang7-Jan-06 7:33 
GeneralRe: class CSystemTray Pin
Jeff Miles8-Jan-06 8:15
memberJeff Miles8-Jan-06 8:15 
Generalfile user.ini Pin
Em_Bang_Lang3-Jan-06 6:01
memberEm_Bang_Lang3-Jan-06 6:01 
GeneralRe: file user.ini Pin
Jeff Miles3-Jan-06 6:50
memberJeff Miles3-Jan-06 6:50 
GeneralRe: file user.ini Pin
Em_Bang_Lang4-Jan-06 6:43
memberEm_Bang_Lang4-Jan-06 6:43 
GeneralSend File Pin
Julia Kien31-Mar-05 1:40
sussJulia Kien31-Mar-05 1:40 
GeneralRe: Send File Pin
Jeff Miles31-Mar-05 17:47
memberJeff Miles31-Mar-05 17:47 
GeneralRe: Send File Pin
uno freeware13-Oct-05 17:51
memberuno freeware13-Oct-05 17:51 
GeneralRe: Send File Pin
uno freeware13-Oct-05 17:51
memberuno freeware13-Oct-05 17:51 
GeneralInternet Pin
all4me27-Sep-04 16:36
memberall4me27-Sep-04 16:36 
Generalport number problem Pin
ordered_chaos11-Sep-04 11:58
memberordered_chaos11-Sep-04 11:58 
i downloaded the program and started trying to get a connection between computers. using my ip address and the port number 4306 i was able to connect from the local computer but when a friend on a different computer tried to connect using the same settings he was unable to... ido you think this is a port number problem or something else? i dont have alot of experience in this area so any pointers would be had.

GeneralRe: port number problem Pin
Jeff Miles14-Sep-04 15:57
memberJeff Miles14-Sep-04 15:57 
GeneralSend Data Pin
pel-nn7-Jul-04 7:58
memberpel-nn7-Jul-04 7:58 
GeneralRe: Send Data Pin
uno freeware13-Oct-05 17:49
memberuno freeware13-Oct-05 17:49 
Generaldetails Pin
dudic13-Mar-03 8:09
memberdudic13-Mar-03 8:09 
GeneralRe: details Pin
Jeff Miles13-Mar-03 11:59
memberJeff Miles13-Mar-03 11:59 
QuestionExcellent but perhaps better explanation within article? Pin
freakmaster27-Nov-02 17:38
sussfreakmaster27-Nov-02 17:38 
AnswerRe: Excellent but perhaps better explanation within article? Pin
snyp24-Jun-03 6:41
membersnyp24-Jun-03 6:41 
GeneralSecurity... Pin
Daniel Turini14-Nov-02 23:16
memberDaniel Turini14-Nov-02 23:16 
GeneralRe: Security... Pin
Jeff Miles15-Nov-02 8:46
memberJeff Miles15-Nov-02 8:46 
GeneralPoor article Pin
Victor Vogelpoel14-Nov-02 21:31
memberVictor Vogelpoel14-Nov-02 21:31 
GeneralRe: Poor article Pin
Jeff Miles15-Nov-02 8:41
memberJeff Miles15-Nov-02 8:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.171207.1 | Last Updated 14 Nov 2002
Article Copyright 2002 by Jeff Miles
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid