Boost logo

Boost Users :

Subject: Re: [Boost-users] Large buffers in boost::asio SSL
From: Scott Gifford (sgifford_at_[hidden])
Date: 2008-12-17 15:33:17


"Patrick Loney" <Patrick.Loney_at_[hidden]> writes:

>>I'm using a boost::asio::ip::tcp::acceptor now to accept the
>>connections. The problem is once the connections are accepted and I
>>start waiting for data on them, several large buffers are allocated
>>for each connection.
>
> You said, "We're working on a server which will provide service to a
> large number of mostly idle, low-bandwidth clients".
>
> My intent was that you drop the connection when data is not being passed
> meaning that although each connection will still have the large buffers
> the number of connections will fluctuate, keeping memory usage at any
> one time manageable, rather than keeping a connection to each client
> open at all times leading to the problems your having.

Ah, sorry, I didn't understand your suggestion correctly.

> Of course there may be some reason you need an idle connection to a
> client at all times but you don't say what purpose this serves.

The server often sends notifications to the clients, and so needs a
way to reach them at any time; the clients also often send messages to
the server. Messages are typically sent or received about every 30
seconds. The clients are on mobile devices connected via cellphone
networks, and these networks use NAT and similar techniques, which
require that the client initiate connections. So the only reliable
way I know of to allow the server to contact these clients immediately
when a notification is available is to have the clients keep a TCP
connection open to the server. Therefore, lots of mostly idle
connections.

Hope that explains our situation better, thanks for your response!

-----Scott.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net