Log if we write out big messages because I saw some stuff about bugs in

Windows where it wigs out and behaves as if the connection was reset by
the peer ("An existing connection was forcibly closed by the remote host")
if one writes messages bigger than about 25k. I can't imagine how we would
be sending such big messages to the server, but it's worth a check.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3159 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2004-10-21 23:36:27 +00:00
parent 34863f4ce0
commit d9eb445d84
@@ -1,5 +1,5 @@
//
// $Id: Communicator.java,v 1.35 2004/08/27 02:20:18 mdb Exp $
// $Id: Communicator.java,v 1.36 2004/10/21 23:36:27 mdb Exp $
//
// Narya library - tools for developing networked games
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
@@ -312,6 +312,10 @@ public class Communicator
// then write the framed message to actual output stream
try {
ByteBuffer buffer = _fout.frameAndReturnBuffer();
if (buffer.limit() > 4096) {
Log.info("Whoa, writin' a big one [msg=" + msg +
", size=" + buffer.limit() + "].");
}
int wrote = _channel.write(buffer);
if (wrote != buffer.limit()) {
Log.warning("Aiya! Couldn't write entire message [msg=" + msg +