Fixed spurious warnings about sockets on bureau shut down:

* socketClosed was issuing a warning, presumably because whirled doesn't normally disconnect flash client. Anyway, seems like overkill since the server can disconnect whenever it choosed
* Accoring to adobe, calling Socket.close after the Socket.close event should throw an IOError. Thane holds to this, while flash apparently does not. Make our code neutral by checking for connected prior to calling close

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5415 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Jamie Doornbos
2008-10-07 16:06:45 +00:00
parent f782ba7f07
commit 3bbd9da353
@@ -145,10 +145,12 @@ public class Communicator
protected function shutdown (logonError :Error) :void
{
if (_socket != null) {
try {
_socket.close();
} catch (err :Error) {
Log.getLog(this).warning("Error closing failed socket [error=" + err + "].");
if (_socket.connected) {
try {
_socket.close();
} catch (err :Error) {
Log.getLog(this).warning("Error closing failed socket [error=" + err + "].");
}
}
removeListeners();
_socket = null;
@@ -288,7 +290,7 @@ public class Communicator
*/
protected function socketClosed (event :Event) :void
{
Log.getLog(this).warning("socket was closed: " + event);
Log.getLog(this).info("socket was closed: " + event);
_client.notifyObservers(ClientEvent.CLIENT_CONNECTION_FAILED);
logoff();
}