Http server based on Ting lib.

28 views
Skip to first unread message

Gall Anonim

unread,
Jan 28, 2014, 12:03:27 PM1/28/14
to lib...@googlegroups.com
Hi,
I just finished small project based on Ting networking library. I made small HTTP server.
It works very good.

See sources: https://bitbucket.org/recone/client-server

Can I get some help with threads? I want to change this app. to work as multithreaded.
I was trying to do this but I can't share pointer to socket between threads.

If you think my cod can be done better - i'm happy to add good code to this small project.

Thank you,
Rafal

Ivan Gagis

unread,
Jan 29, 2014, 7:12:16 AM1/29/14
to lib...@googlegroups.com
Hi Rafal,

I checked out your code and made some comments on bitbucket.

I can advice about threads. I don't think you really need to share a
pointer to socket between threads, you might need to pass a socket from
one thread to another. Basically, you can use ting::mt::Message to
achieve that. There is a WiKi page on ting.googlecode.com about how to
use messages.

I have an alpha version of a multithreaded server using ting, you can
have a look at http://cliser.googlecode.com
There are not much documents there but there are some test apps which
can be used as a code examples. It might seem a bit complex, but this is
what it turned out to be. Have a look, maybe you will find it useful and
make your http server based on cliser.

If any questions, please ask.

Thanks,
Ivan
> --
> You received this message because you are subscribed to the Google
> Groups "libting" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to libting+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Gall Anonim

unread,
Jan 30, 2014, 5:23:50 AM1/30/14
to lib...@googlegroups.com
Thank you,
I will add  this changes.

I will try to see how you manage threading in your HTTP server.

Thank you,
Rafal

Gall Anonim

unread,
Jan 30, 2014, 6:11:42 AM1/30/14
to lib...@googlegroups.com
Next thing is to add support for PHP5 CLI or PHP5 cgi.
I know PHP5-FPM can communicate with http server on socket or pid.
I have even tryd php5-fpm to listen on port and it works great.

:D

Rafal
Reply all
Reply to author
Forward
0 new messages