InterviewSolution
| 1. |
Why Does Isocket_release() Return One When We Are Expecting A Return Value Of Zero? |
|
Answer» When an application CALLS ISOCKET_Release(), the internal state of the ISocket object CHANGES to "CLOSING," and BREW begins waiting for the asynchronous "closed" EVENT. Since the closed event is received in a callback, the reference count of the ISocket object is incremented to PREVENT it from being released before its internal state changes to closed. When an application calls ISOCKET_Release(), the internal state of the ISocket object changes to "closing," and BREW begins waiting for the asynchronous "closed" event. Since the closed event is received in a callback, the reference count of the ISocket object is incremented to prevent it from being released before its internal state changes to closed. |
|