unknown compression method

Post here your questions about the C++ API for SFS2X

Moderators: Lapo, Bax, MBagnati

Post Reply
scofy
Posts: 79
Joined: 08 Apr 2012, 09:04

unknown compression method

Post by scofy »

In the SimpleChat example,I want to send a public message with a lot of words,modify CChatFrm::OnClickedButtonSendChatMessage()

Code: Select all

	std::string* stdChatMessage = new string(pszConvertedAnsiString);
replace with these codes

Code: Select all

        int size  = 1024;
	char* str = new char[size+1];
	for(int i=0;i<size;i++){
		 str[i] = 'a';
	}
	str[size] = '\0';
	std::string* stdChatMessage = new string(str);
2X server which version is 2.0.1 will appear this warning,and client will not receive the event SFSEvent::PUBLIC_MESSAGE.
07:23:05,570 WARN [SocketReader] binary.BinaryIoHandler - unknown compression method

However,i update the server to 2.6.0 and test it again,there are server log messages:
07:50:43,882 WARN [SocketReader] binary.BinaryIoHandler - java.util.zip.DataFormatException:
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Exception: java.util.zip.DataFormatException
Message: unknown compression method
+--- --- ---+
Stack Trace:
+--- --- ---+
java.util.zip.Inflater.inflateBytes(Native Method)
java.util.zip.Inflater.inflate(Inflater.java:238)
java.util.zip.Inflater.inflate(Inflater.java:256)
com.smartfoxserver.v2.protocol.binary.DefaultPacketCompressor.uncompress(DefaultPacketCompressor.java:92)
com.smartfoxserver.v2.protocol.binary.BinaryIoHandler.handlePacketData(BinaryIoHandler.java:468)
com.smartfoxserver.v2.protocol.binary.BinaryIoHandler.handleRead(BinaryIoHandler.java:231)
com.smartfoxserver.v2.protocol.SFSIoHandler.onDataRead(SFSIoHandler.java:131)
com.smartfoxserver.bitswarm.core.SocketReader.readTcpData(SocketReader.java:338)
com.smartfoxserver.bitswarm.core.SocketReader.readIncomingSocketData(SocketReader.java:222)
com.smartfoxserver.bitswarm.core.SocketReader.run(SocketReader.java:173)
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
java.lang.Thread.run(Thread.java:680)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
bqlf1907
Posts: 25
Joined: 13 May 2013, 10:28

Re: unknown compression method

Post by bqlf1907 »

Packet can not be too large???
MBagnati
Posts: 126
Joined: 12 Feb 2013, 10:57

Re: unknown compression method

Post by MBagnati »

We are investigating the problem. Please give us a little time to understand the cause of the mistake. Thanks
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: unknown compression method

Post by Bax »

Please contact us by email and we will send you an updated ByteArray class which should fix both this issue and the other one you described in this post: http://forums.smartfoxserver.com/viewto ... 055#p68698
Paolo Bax
The SmartFoxServer Team
scofy
Posts: 79
Joined: 08 Apr 2012, 09:04

Re: unknown compression method

Post by scofy »

Thanks,the new class fix my problems!
MBagnati
Posts: 126
Joined: 12 Feb 2013, 10:57

Re: unknown compression method

Post by MBagnati »

Fix is included into API version 0.9.6
Post Reply