On 23 April 2011 17:31, Ken Wesson <kwess...@gmail.com> wrote:
> On Sat, Apr 23, 2011 at 5:12 AM, Zlatko Josic <zlatko.jo...@gmail.com> wrote:
>> Hi,
>> I would like to start two progams from Eclipse. One is a server and the
>> other one is a client.
>> I use Load Clojure file in REPL from Eclipse menu. When I start the server
>> it never ends because
>> the server has endless loop where it waits for clients. Now when I start the
>> client programs it never
>> evaluates because REPL is busy with server program. I suppose it works as I
>> described. Maybe I am
>> wrong I am not sure.
>> Any ideas to overcame this situation are welcome.
>
> Have the server spawning function (or both, if the client is GUI) just
> start a separate thread and immediately return.
>
> (In fact, servers normally are multithreaded anyway, aren't they, to
> be able to handle multiple concurrent incoming requests.)

Well, Java servers probably are yes, but traditional Unix servers
would normally fork a new process for each incoming connection.

There are various ways of doing it.  A separate process per client
connection; a separate thread per client connection; a single
process/thread handling multiple clients with select()/poll()/etc. and
combinations or variations on these.  e.g. starting a pool of
processes to avoid the startup time of a new process when a new client
connects.

-- 
Michael Wood <esiot...@gmail.com>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to