kerryjiang / SuperSocket

SuperSocket is a light weight, cross platform and extensible socket server application framework.
Apache License 2.0
3.94k stars 1.14k forks source link

cannot send request larger than 1k #89

Closed electronik54 closed 7 years ago

electronik54 commented 7 years ago

here is my client side code jsFiddle $(document).ready(function () { //THIS WILL MAKE ATTEMPT TO CREATE SOCKET CONNECTION WITH CONSOLE exe RUNNING ON SERVER connectWebSocket(); ws.onopen = function () { TestSocket(); }; ws.onmessage = function (evt) { //debugger; console.log("Message Received!"); var data = JSON.parse(evt.data); console.log(data); }; function TestSocket() { if (ws) { console.log("firing test func..."); var jsonStr = JSON.stringify({ "CallFunc": "testFunc" , "para": /**/ "IDT|13,CFT|13,P1|13,DPIT|13,POS|13,P2|13,AI5|13,AI5V|13,AI1|13,POS|13,AI2|13,DPIT|13,AI3|13,P1|13,AI4|13,P2|13,AI5|13,AI5V|13,AI5V|13,CFT|13,P1P2CFT|13,BAT|13,CVCAL|13,CVT|13,CVMOD|13,CVPOS|13,CVDPT|13,SO1|13,SO2|13,POS|13,AI1|13,CVPOS|13,CALMIN|13,CALMAX|13,CVMOD|13,AI2|13,CVDPT|13,P1|13,P2|13,AI3|13,AI3COUNT|13,AI3COUNTMIN|13,AI3COUNTMAX|13,P1|13,AI3SCALEMIN|13,AI3SCALEMAX|13,AI3COUNTMINTEMP|13,AI3VALUEMINTEMP|13,AI3COUNTMAXTEMP|13,AI3VALUEMAXTEMP|13,AI4|13,AI4COUNT|13,AI4COUNTMIN|13,AI4COUNTMAX|13,P2|13,AI4SCALEMIN|13,AI4SCALEMAX|13,AI4COUNTMINTEMP|13,AI4VALUEMINTEMP|13,AI4COUNTMAXTEMP|13,AI4VALUEMAXTEMP|13,AI2|13,AI2COUNT|13,AI2COUNTMIN|13,AI2COUNTMAX|13,DPIT|13,AI2SCALEMIN|13,AI2SCALEMAX|13,AI2COUNTMINTEMP|13,AI2VALUEMINTEMP|13,AI2COUNTMAXTEMP|13,AI2VALUEMAXTEMP|13,AI5V|13,AI5COUNT|13,AI5COUNTMIN|13,AI5COUNTMAX|13,AI5V|13,AI5SCALEMIN|13,AI5SCALEMAX|13,AI5COUNTMINTEMP|13,AI5VALUEMINTEMP|13,AI5COUNTMAXTEMP|13,AI5VALUEMAXTEMP|13,AI1|13,AI1COUNT|13,AI1COUNTMIN|13,AI1COUNTMAX|13,POS|13,|13,|13,AI1COUNTMINTEMP|13,AI1VALUEMINTEMP|13,AI1COUNTMAXTEMP|13,AI1VALUEMAXTEMP|13,AI1VALUEMAXTEMP|13,AI1VALUEMAXTEMP|13,AI1VALUEMAXTEMP|13,AI1VALUEMAXTEMP|13,AI1VALUEMAXTEMP|13,AI1VALUEMAXTEMP|13,AI1VALUEMAXTEMP|13,AI1VALUEMAXTEMP|13,AI1VALUEMAXTEMP|13,AI1VALUEMAXTEMP|13" /* (function () { var retStr = '' , i = 0; while (retStr.length < 1000) { retStr += "The number is " + i; i++; } console.log(retStr); console.log("retStr length::" + retStr.length); return retStr; }).call(this) */ }); console.log("jsonStr.length::" + jsonStr.length); console.log("lengthInUtf8Bytes.length::" + lengthInUtf8Bytes(jsonStr)); ws.send(jsonStr); } }; });

and this is server configuration c# Pad AppServer.Setup( new ServerConfig { Name = "wmsSocket", Ip = "Any", Port = PortNum, Mode = SocketMode.Tcp, IdleSessionTimeOut = 100000, KeepAliveTime = 10000, SendTimeOut = 20000, ReceiveBufferSize = 10000000, SendBufferSize = 10000000, })

whenever i make the attempt connect server with this config, my connection is closed. Please find log file attached to this post

Logs.zip

kerryjiang commented 7 years ago

There is a setting in the server side "maxRequestLength", the default value of it is 1000. So you better change it in your setup code.

electronik54 commented 7 years ago

thanks for the reply it worked... where can i find the documentation related to server configuration, their max/min/default values?

kerryjiang commented 7 years ago

Here http://docs.supersocket.net/v1-6/en-US/SuperSocket-Basic-Configuration