Yes yes I know that this choice is not scalable and portable...but I only have 10 or at most 15 request...so I think that a process could be a solution..besides I need that each connection are separated from the other..
However, excuse but I'm a noob...for example..to obtain the listen socket:
int listensd=socket(....);

I have to do something like this?:
boost::asio::ip::tcp::socket s;
int listen sd=s.native_type();


Da: Igor R <boost.lists@gmail.com>
A: boost-users@lists.boost.org
Inviato: Mer 2 marzo 2011, 09:06:44
Oggetto: Re: [Boost-users] boost::asio multiprocess

> Thank you for your reply,what do you mean with native_type ? is a boost function?

It's a member function of asio objects. Eg., calling
yourSocket.native_type() gives you a native socket handle.
In versions prior ro 1.46 it's called native_handle(), IIRC.

> I need to make a multi process TCP Server..so I think it is mandatory to me
> to "parallelize" the server with process...are you sure that is enough to
> use the asynchronous model?

Well, I don't know where your requirements come from and what you do
in your "process_it()" function. If it's an excercise in making
multiple processes with fork(), or if you have heavy processing task
and cannot enqueue it to a dedicated thread for some reason -- then
you probably don't have a choice.
But note that your solution is non-portable and not scalable. Think
what happens with your server under high load - say, 10000 incoming
requests. Are you sure launching 10000 processes would be a good idea?
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users