I'm having trouble sending byte arrays from the server to the client. Sometimes the client throws an exception:
Code: Select all
Error: DumpFormatter: the indentPos is not == 0. TOKENS ARE NOT BALANCED!
at com.smartfoxserver.v2.protocol.serialization::DefaultObjectDumpFormatter$/prettyPrintDump()[/Users/Lapo/Documents/Flex Builder 3/SFS2X_AS3_API/src/com/smartfoxserver/v2/protocol/serialization/DefaultObjectDumpFormatter.as:58]
at com.smartfoxserver.v2.entities.data::SFSObject/getDump()[/Users/Lapo/Documents/Flex Builder 3/SFS2X_AS3_API/src/com/smartfoxserver/v2/entities/data/SFSObject.as:112]
at com.smartfoxserver.v2.bitswarm::Message/toString()[/Users/Lapo/Documents/Flex Builder 3/SFS2X_AS3_API/src/com/smartfoxserver/v2/bitswarm/Message.as:58]
at Array$/_join()
at Array/http://adobe.com/AS3/2006/builtin::join()
at com.smartfoxserver.v2.logging::Logger/info()[/Users/Lapo/Documents/Flex Builder 3/SFS2X_AS3_API/src/com/smartfoxserver/v2/logging/Logger.as:80]
at com.smartfoxserver.v2.controllers::ExtensionController/handleMessage()[/Users/Lapo/Documents/Flex Builder 3/SFS2X_AS3_API/src/com/smartfoxserver/v2/controllers/ExtensionController.as:29]
at com.smartfoxserver.v2.core::SFSProtocolCodec/dispatchRequest()[/Users/Lapo/Documents/Flex Builder 3/SFS2X_AS3_API/src/com/smartfoxserver/v2/core/SFSProtocolCodec.as:97]
at com.smartfoxserver.v2.core::SFSProtocolCodec/onPacketRead()[/Users/Lapo/Documents/Flex Builder 3/SFS2X_AS3_API/src/com/smartfoxserver/v2/core/SFSProtocolCodec.as:39]
at com.smartfoxserver.v2.core::SFSIOHandler/handlePacketData()[/Users/Lapo/Documents/Flex Builder 3/SFS2X_AS3_API/src/com/smartfoxserver/v2/core/SFSIOHandler.as:229]
at com.smartfoxserver.v2.core::SFSIOHandler/onDataRead()[/Users/Lapo/Documents/Flex Builder 3/SFS2X_AS3_API/src/com/smartfoxserver/v2/core/SFSIOHandler.as:88]
at com.smartfoxserver.v2.bitswarm::BitSwarmClient/onSocketData()[/Users/Lapo/Documents/Flex Builder 3/SFS2X_AS3_API/src/com/smartfoxserver/v2/bitswarm/BitSwarmClient.as:319]
Here is a sample byte array that always throws the exception:
Code: Select all
ISFSObject testObject = new SFSObject();
byte[] tb = new byte[] { 73, -56, 0, -97, -87, -67, -68, -124, 30, -41, 84, 21, -39,
114, -107, -99, -85, 53, -100, -56, 17, -56, -16, 112, 67, -12, 75, 119, -41,
119, -52, 48, -19, 29, 2, -75, -12, -55, 70, -14, -37, -82, 77, 93, -122, 47,
-81, -114, -84, -32, 79, -50, -126, 92, -83, -6, -101, 0, -66, -125, -127, -96,
-109, 62, 114, -27, 15, -55, 84, 82, 27, 25, -69, 32, 48, -51, 21, 22, 115, 88,
100, 111, -72, 53, -97, 30, 32, -23, 123, -25, 87, -71, -105, -5, 87, 70, 121, 100,
113, 50, -107, -43, 32, -121, 95, -12, -52, -13, -26, 51, -43, -24, -128, -25,
77, 53, -78, 28, 3, -118, 61, -73, 112, -28, 35, 117, -89, 17, -107, -77, -122,
-88, -92, -93, 59, 48, -35, 4, 21, -128, -107, 87, 64, -97, 110, -111, -30, 46,
-6, -71, -127, -13, 78, -42, 12, 30, -69, 53, -120, 65, -43, 71, -32, -118, 52,
35, -108, -21, -88, -15, 87, -55, 31, -18, -15, 94, 110, 93, 60, -104, 1, -83,
17, -97, 93, 6, 70, 101, 110, -45, 50, 119, 78, 33, 8, -39, 109, -128, 52, 94,
-38, 17, 111, -31, -64, -108, -80, 57, -47, 121, 28, -35, -94, -104, 10, -13 };
testObject.putByteArray( "m", tb );
ce.getApi().sendExtensionResponse( CommonCommandNames.SYSTEM_MOVE_SEND, testObject, user, room, false );