Re: [Socket Programming]: Need info for Client / Server scenario

From: Andrew Gaffney (agaffney_at_skylineaero.com)
Date: 05/31/04


Date: Sun, 30 May 2004 23:20:17 -0500
To:  suresh.pasupula@wipro.com

suresh.pasupula@wipro.com wrote:
> I need some good links for understanding socket programming (Client /
> Server programming).
>
> I have written some scripts for multiple clients and a server (Forking
> Server).
>
> But I am facing some problems - the server data has to be shared among
> all the child processes - does this happen when we fork - what should I
> do for this to happen.
>
> Requirement is:
>
> "Normal clients" keep polling the server for some info.
>
> Server will get some info from a "master client" till then the server
> responds back with null info to the "Normal clients".
>
> The server data that my master client is updating should get reflected
> in all the child processes (of forked server) - this is not happening.
> What should I do to achieve this?
>
> Also I want my server to respond back immediately to all the clients
> getting connected. This is not happening.

Warning: the following is coming from someone who has never written any programs
with multi-connection servers, forking, or threads, but I have done lots of
reading ;)

It seems to me that it would work better in your situation to start separate
threads instead of forking in your program. It would allow you to easily have a
shared memory space, and I believe threads aren't quite as "expensive" as new
processes (forking).

Again, keep in mind that you should take anything I say with a grain of salt.
Anything I say in this thread should be assumed wrong until verified by someone
who has some idea what they are talking about :)

-- 
Andrew Gaffney
Network Administrator
Skyline Aeronautics, LLC.
636-357-1548


Relevant Pages

  • Re: Will FM do what I need to replace old FoxBase+/Mac app?
    ... Filemaker "programming" is scripting - mainly assigned to objects on the layout/form. ... Advanced to develop the app and FM Server to serve the data. ... tables that process, store, and update information about printing clients ...
    (comp.databases.filemaker)
  • Basic questions for designing the COM Server
    ... I am working with VC++ 2005 and I love this attributed programming. ... threads and a thread for communication to the outer world. ... and I expect multiple clients calling the server in the same time. ... Clients will mostly be scripts, so they will run in STA. ...
    (microsoft.public.vc.atl)
  • Re: pythons threading has no "interrupt"?
    ... the server ran on multiple OS platforms so OS level ... but it should still be very doable with just threads (as opposed to forking ... a watchdog cannot distinguish between slow progress and no progress. ... with having a bookkeeping thread in Python either. ...
    (comp.lang.python)
  • Re: Forking Java GUI Apps
    ... we are also considering forking the X server for the ... This would allow the child to execute normally and would even ... restore an older one in case of a bug). ...
    (comp.os.linux.development.system)
  • Re: Need help with a simple UNIX sockets server based on IO::Socket::UNIX
    ... I've tried to create a simple client + server that communicate ... server script (which listens eternally, but can accept only one connection ... There's also no forking. ...
    (comp.lang.perl.modules)