logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Third-party Modules View previous topic :: View next topic
Reply to topic   Topic: Websocket handler module: running exe and starting 2 threads
Author
giustino



Joined: 21 Feb 2014
Posts: 2

PostPosted: Fri 21 Feb '14 19:28    Post subject: Websocket handler module: running exe and starting 2 threads Reply with quote

Hi everyone,

Currently, websockets are running well with python websocket module (mod_pywebsocket) on my apache server.

But now, i need to convert python code part into C because i replaced mod_pywebsocket with mod_websocket (apache module).

Normally, that would not be a big deal. But i'm not familiar with apache libraries (apr_* and all those types). How could i write a similar code in C that would run an executable and start 2 threads ?

Actually, my python websocket handler is doing this:

It opens an executable (C++) and redirects stdin/stdout.
Then it runs 2 threads: one called ThreadReader and the other called ThreadWriter.

Can someone give me some help with apache C structure of code to run an executable and create 2 threads in the websocket handler ?
Back to top
jimski



Joined: 18 Jan 2014
Posts: 196
Location: USSA

PostPosted: Sat 22 Feb '14 8:08    Post subject: Reply with quote

Maybe this will help.
http://stackoverflow.com/questions/56810/how-do-i-start-threads-in-plain-c
http://www.cs.cf.ac.uk/Dave/C/node32.html
Back to top
giustino



Joined: 21 Feb 2014
Posts: 2

PostPosted: Sat 22 Feb '14 14:30    Post subject: Reply with quote

Thank you but this is not what i need.

Posix thread is something i can do. The main problem here is APR from apache. I'm not very familiar with it.

Right now, i'm learning APR and i'm trying to run an executable using
Code:
apr_proc_create
(with pipe for stdin/stdout).

I also saw how to manage threads in APR. Maybe i'll find a way through but if someone can help me, i won't say no
Back to top


Reply to topic   Topic: Websocket handler module: running exe and starting 2 threads View previous topic :: View next topic
Post new topic   Forum Index -> Third-party Modules