1. Sockets programming and threading
Hi everyone,
I am writing a wrapper for Tcp4u (a cross platform sockets library) and I
have a fair amount done .... BUT ... I have come across a problem.
All of the c/c++ examples of server programs that can accept multiple
clients do it by the use of threads.
Basically one thread is always doing an accept (waiting for a connection),
and when a connection is made it is passed to another thread ... so the
original thread can go on waiting to see if more clients wants to connect.
I have no idea how to simulate this in Euphoria and since it is single
threaded.
Has anyone come across this before or have any ideas?
I have the first windows version of euTcp4u almost complete, just finishing
the doco and making some more example programs (that's when I got stuck with
my problem!).
Thanks
Ray Smith.
2. Re: Sockets programming and threading
- Posted by "Hawke'" <mikedeland at NETZERO.NET>
Sep 08, 2000
-
Last edited Sep 09, 2000
(not tooting horn or nuffin here)
u may wish to look at my EUServer in the archives
it does exactly that what u mention
it maintains a socket open that listens at all times
which i nicknamed Belvedere, .....
so all the references in the text of the code and such
to belvedere are that first socket that hands off to another
descriptor to make a perma-connection to a user and then
belvedere begins listening for more connections
reason i choose belvedere? bugs bunny, southern gentleman
always calling his pooch...OH BELVEDERE, come HERE boy!
=]
kinda reminded me that was what i was doing
when someone enters the EUServer ....
take care
--Hawke'
----- Original Message -----
From: Ray & Debbie Smith <smithr at IX.NET.AU>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Friday, September 08, 2000 5:37 PM
Subject: Sockets programming and threading
> Hi everyone,
>
> I am writing a wrapper for Tcp4u (a cross platform sockets library) and I
> have a fair amount done .... BUT ... I have come across a problem.
>
> All of the c/c++ examples of server programs that can accept multiple
> clients do it by the use of threads.
>
> Basically one thread is always doing an accept (waiting for a connection),
> and when a connection is made it is passed to another thread ... so the
> original thread can go on waiting to see if more clients wants to connect.
>
> I have no idea how to simulate this in Euphoria and since it is single
> threaded.
>
> Has anyone come across this before or have any ideas?
>
> I have the first windows version of euTcp4u almost complete, just finishing
> the doco and making some more example programs (that's when I got stuck with
> my problem!).
>
> Thanks
>
> Ray Smith.
>
_____NetZero Free Internet Access and Email______
http://www.netzero.net/download/index.html