You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modules-dev@httpd.apache.org by milad rezai <re...@ncc-gnss.com> on 2011/08/21 16:57:58 UTC

I need some idea about one unusual module with threaded communication :

How can I communicate between different thread (one thread per client)?

Problem : I need to develop a module with persistent connections, I have two
kind of clients : one of them persistently sends data on connection and
another must use and get from first kind of connections and place on his
socket for feeding his client?

Now how can I handle this type of module? Is Apache module development
platform enough for writing this?

sincerely,
Milad Rezaei Fili,
Senior software management of NCC(National Cryptography Center).

Re: I need some idea about one unusual module with threaded communication :

Posted by Nick Kew <ni...@apache.org>.
On Mon, 22 Aug 2011 07:21:25 -0600
Joe Lewis <jl...@silverhawk.net> wrote:

> On Sun, Aug 21, 2011 at 8:57 AM, milad rezai <re...@ncc-gnss.com> wrote:
> 
> > How can I communicate between different thread (one thread per client)?
> >
> > Problem : I need to develop a module with persistent connections, I have
> > two
> > kind of clients : one of them persistently sends data on connection and
> > another must use and get from first kind of connections and place on his
> > socket for feeding his client?
> >

I didn't reply to that because the problem description confuses me.
How many connections, and where do they come from?  Doesn't sound
like standard HTTP!

> Consider using shared memory - or shm.

Makes sense ... probably!

>    Using a search engine and "apache
> module shared memory example" gives a previous thread on this list :
> 
> http://marc.info/?l=apache-modules&m=113977658131259
> 
> In it, Nick gives a pointer to look at the util_ldap source.

That's old!

These days we have two shared memory frameworks: slotmem and socache.
I'd look there first, rather than duplicate older code.


-- 
Nick Kew

Re: I need some idea about one unusual module with threaded communication :

Posted by Joe Lewis <jl...@silverhawk.net>.
On Sun, Aug 21, 2011 at 8:57 AM, milad rezai <re...@ncc-gnss.com> wrote:

> How can I communicate between different thread (one thread per client)?
>
> Problem : I need to develop a module with persistent connections, I have
> two
> kind of clients : one of them persistently sends data on connection and
> another must use and get from first kind of connections and place on his
> socket for feeding his client?
>

Consider using shared memory - or shm.  Using a search engine and "apache
module shared memory example" gives a previous thread on this list :

http://marc.info/?l=apache-modules&m=113977658131259

In it, Nick gives a pointer to look at the util_ldap source.



> Now how can I handle this type of module? Is Apache module development
> platform enough for writing this?
>

The examples will show you that there are components to the API that can be
used (for portability).

Hopefully, this will help.

Joe