tech1guy
asked on
client-server
Hi experts,
I've a simple client and server in C on unix platform. The server displays the date in 'mm/dd/yy' OR 'dd/mm/yy' format depending upon the requested format by client.
It's running absolutly fine, but it's for single client. Now, I'm trying to implement it for multiple clients using select(), it's going fine, but is it possible for server to remember the choice for every client?
I mean can the server remember which client requests date in which format?
Thanks in advance
I've a simple client and server in C on unix platform. The server displays the date in 'mm/dd/yy' OR 'dd/mm/yy' format depending upon the requested format by client.
It's running absolutly fine, but it's for single client. Now, I'm trying to implement it for multiple clients using select(), it's going fine, but is it possible for server to remember the choice for every client?
I mean can the server remember which client requests date in which format?
Thanks in advance
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Well, your problem is that you some sort of connection set up (I was assuming a socket in the above) and need to associate data (settings in your case) with that connection. So you have to somehow 'bundle' that information, and that's where structs come in handy.
ASKER
I'm not closing connection after each client is served. I'm using Select()method instead of Fork. Will your technique work with my scenario?
Yes, you only need to store the data for each connection seperately, regardless of how you maintain the communication itself.
ASKER
thanks! it helps
ASKER