Click here to Skip to main content
15,897,187 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Unique Question .... Pin
Zac Howland20-Nov-06 5:39
Zac Howland20-Nov-06 5:39 
GeneralRe: Unique Question .... Pin
Programm3r20-Nov-06 19:20
Programm3r20-Nov-06 19:20 
GeneralRe: Unique Question .... Pin
Zac Howland21-Nov-06 3:32
Zac Howland21-Nov-06 3:32 
AnswerRe: Unique Question .... Pin
Scott Holt20-Nov-06 14:51
Scott Holt20-Nov-06 14:51 
GeneralRe: Unique Question .... Pin
Programm3r20-Nov-06 19:26
Programm3r20-Nov-06 19:26 
QuestionRe: Unique Question .... Pin
Programm3r20-Nov-06 19:53
Programm3r20-Nov-06 19:53 
QuestionRe: Unique Question .... Pin
Zac Howland21-Nov-06 3:35
Zac Howland21-Nov-06 3:35 
AnswerRe: Unique Question .... Pin
led mike21-Nov-06 4:43
led mike21-Nov-06 4:43 
« Programm3r » wrote:
the computer name which the server uses to know with which client it's communicating gets overwritten by the next connection.


Well that would be a "bug". Something is wrong with the code, perhaps a code error or a flaw in the design. A flaw in the design would require changing the design to resolve the problem.

I assume you are using TCP (Stream) connection, yes?
Is it stateful or stateless? Depending on that answer the design is different in only one aspect otherwise it is the same:

Each connection is considered a "Session" and any "state" required is maintained with the Socket handle. Threading or Overlapped IO is used to read/write data and of course perform required logic. Your protocol indicates you could also use a finite state machine implementation.

If it is a stateless protocol then you must add session identification and maintain session in the server.

It's basically that simple. If your design does not reflect that then you are likely in for a bumpy ride.

[After further reading of your post]

« Programm3r » wrote:
When the client(s) connects the server uses a function to find a free slot.


Without a requirement that enforces the need for that behavior, that is a "bad" design.

« Programm3r » wrote:
When the client(s) connects the server uses a function to find a free slot.


That description makes it sound like the server is single threaded. Handling the Server socket "accept" and the client connection communications on the same thread. If that is true that is a "bad" if not "horrible" (as in dead) design. Again without being aware of any specific requirements that would force that design it is just plain wrong.


led mike

QuestionConvert pdf to tiff Pin
Dudi Avramov20-Nov-06 3:58
Dudi Avramov20-Nov-06 3:58 
AnswerRe: Convert pdf to tiff Pin
Waldermort20-Nov-06 5:22
Waldermort20-Nov-06 5:22 
QuestionCFileDialog dialog box does not come up for some unknown reason Pin
cy163@hotmail.com20-Nov-06 3:41
cy163@hotmail.com20-Nov-06 3:41 
AnswerRe: CFileDialog dialog box does not come up for some unknown reason Pin
David Crow20-Nov-06 4:02
David Crow20-Nov-06 4:02 
GeneralRe: CFileDialog dialog box does not come up for some unknown reason Pin
Mila02520-Nov-06 20:21
Mila02520-Nov-06 20:21 
QuestionGet pointer to an control on TabCtrl? [modified] Pin
bosfan20-Nov-06 3:19
bosfan20-Nov-06 3:19 
GeneralC++ Newbie needs data on projects (dsw) and builds Pin
Brady Kelly20-Nov-06 3:07
Brady Kelly20-Nov-06 3:07 
QuestionExport CString object from Dll Pin
Hadi Dayvary20-Nov-06 1:12
professionalHadi Dayvary20-Nov-06 1:12 
AnswerRe: Export CString object from Dll Pin
Mark Salsbery20-Nov-06 5:28
Mark Salsbery20-Nov-06 5:28 
Questionloading active-x control(ocx) at runtime. Pin
pv_pravin20-Nov-06 0:14
pv_pravin20-Nov-06 0:14 
AnswerRe: loading active-x control(ocx) at runtime. Pin
Cedric Moonen20-Nov-06 1:40
Cedric Moonen20-Nov-06 1:40 
GeneralRe: loading active-x control(ocx) at runtime. Pin
TClarke20-Nov-06 3:12
TClarke20-Nov-06 3:12 
GeneralRe: loading active-x control(ocx) at runtime. Pin
Cedric Moonen20-Nov-06 4:25
Cedric Moonen20-Nov-06 4:25 
GeneralRe: loading active-x control(ocx) at runtime. Pin
TClarke20-Nov-06 4:52
TClarke20-Nov-06 4:52 
GeneralRe: loading active-x control(ocx) at runtime. Pin
pv_pravin20-Nov-06 17:58
pv_pravin20-Nov-06 17:58 
GeneralRe: loading active-x control(ocx) at runtime. Pin
pv_pravin20-Nov-06 17:52
pv_pravin20-Nov-06 17:52 
GeneralRe: loading active-x control(ocx) at runtime. Pin
TClarke21-Nov-06 1:40
TClarke21-Nov-06 1:40 

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.