This is just to discuss about a possible bug in a code example of the programming erlang book.<br>On pg 198, the wait_login_response function is called on connection to the server, if you notice, the receive loop doesn't consider the possibility of the user closing the client widget while the client process waits for a response from the server. If this happens, the client receives a widget-destroyed message from the widget but doesn't understand it because the receive loop doeesn't have such a pattern, and so it matches it to the pattern "Other" and then loops infintely till the login request to the server succeeds.<br>
On login success, the active function gets called and the client tries to send received-messages to the widget process that just died, this results in the client crashing.. <br>A neater way of handling this would be to handle widget-destroyed message in wait_login_response and gracefully terminate the client process during such an event<br>
<br>Best wishes,<br>Joel<br><br>