| 7 | namespace acl { |
| 8 | |
| 9 | aio_socket_stream::aio_socket_stream(aio_handle* handle, |
| 10 | ACL_ASTREAM* stream, bool opened /* = false */) |
| 11 | : aio_stream(handle), aio_istream(handle), aio_ostream(handle) |
| 12 | , open_callbacks_(NULL) |
| 13 | { |
| 14 | acl_assert(handle); |
| 15 | acl_assert(stream); |
| 16 | |
| 17 | if (opened) { |
| 18 | status_ |= STATUS_CONN_OPENED; |
| 19 | } |
| 20 | |
| 21 | stream_ = stream; |
| 22 | |
| 23 | // ���û���� enable_error ���� handle �������첽������, |
| 24 | // ͬʱע��رռ���ʱ�ص����� |
| 25 | this->enable_error(); |
| 26 | |
| 27 | // ֻ�е������ӳɹ���ſ� hook IO ��д״̬ |
| 28 | if (opened) { |
| 29 | // ע����ص����� |
| 30 | this->enable_read(); |
| 31 | |
| 32 | // ע��д�ص����� |
| 33 | this->enable_write(); |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | aio_socket_stream::aio_socket_stream(aio_handle* handle, ACL_SOCKET fd) |
| 38 | : aio_stream(handle), aio_istream(handle), aio_ostream(handle) |
nothing calls this directly
no test coverage detected