Avoid calling bytesAvailable if the socket is not connected. It causes needless
exception throwage. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5711 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -67,11 +67,10 @@ public class FrameReader extends EventDispatcher
|
|||||||
protected function readAvailable () :void
|
protected function readAvailable () :void
|
||||||
{
|
{
|
||||||
if (ObjectInputStream.DEBUG) {
|
if (ObjectInputStream.DEBUG) {
|
||||||
Log.getLog(this).debug(
|
Log.getLog(this).debug("socketHasData(" + _socket.bytesAvailable + ")");
|
||||||
"socketHasData(" + _socket.bytesAvailable + ")");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
while (_socket.bytesAvailable > 0) {
|
while (_socket.connected && _socket.bytesAvailable > 0) {
|
||||||
if (_curData == null) {
|
if (_curData == null) {
|
||||||
if (_socket.bytesAvailable < HEADER_SIZE) {
|
if (_socket.bytesAvailable < HEADER_SIZE) {
|
||||||
// if there are less bytes available than a header, let's
|
// if there are less bytes available than a header, let's
|
||||||
|
|||||||
Reference in New Issue
Block a user