This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
thevoid:api [2013/11/21 17:21] elessar [Lifetime] |
thevoid:api [2013/11/21 17:21] (current) elessar [Lifetime] |
||
---|---|---|---|
Line 61: | Line 61: | ||
//thevoid::reply_stream// holds shared pointer to the //thevoid::request_stream//. This pointer is reseted as //reply_stream::close// method is called or any error occurs. If //request_stream// makes any asynchronous requests it's recommended to make it //enable_shared_from_this// successor, so it will be possible either be notified about the stream's death or provide it longer life. | //thevoid::reply_stream// holds shared pointer to the //thevoid::request_stream//. This pointer is reseted as //reply_stream::close// method is called or any error occurs. If //request_stream// makes any asynchronous requests it's recommended to make it //enable_shared_from_this// successor, so it will be possible either be notified about the stream's death or provide it longer life. | ||
- | //reply_stream// lives until the socket connection or //request_stream// are alive, so it's always safe to call any of it's methods, if error occurs (write error or any other) //request_stream::on_close// will be called and pointer will be reseted. | + | //reply_stream// lives until connection to the client or //request_stream// are alive, so it's always safe to call any of it's methods, if error occurs (write error or any other) //request_stream::on_close// will be called and pointer will be reseted. |