Giter Site home page Giter Site logo

Comments (12)

ilsnk avatar ilsnk commented on June 29, 2024

We use latest library version

from netcoreserver.

selmanahatli avatar selmanahatli commented on June 29, 2024

I have same problem with 7.0.0 version. Is there any progress about this issue?
Or could yo fix that in a different way? @ilsnk

from netcoreserver.

suleymanbyzt avatar suleymanbyzt commented on June 29, 2024

Same problem any update ?

from netcoreserver.

ilsnk avatar ilsnk commented on June 29, 2024

We have not yet had time to independently study this problem. We are still getting this error.

from netcoreserver.

suleymanbyzt avatar suleymanbyzt commented on June 29, 2024

I still keep getting this error. How can I handle this? @chronoxor

Unhandled exception. System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'length') at NetCoreServer.WebSocket.PrepareReceiveFrame(Byte[] buffer, Int64 offset, Int64 size) at NetCoreServer.TcpSession.ProcessReceive(SocketAsyncEventArgs e) at NetCoreServer.TcpSession.OnAsyncCompleted(Object sender, SocketAsyncEventArgs e) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)

thank you for your help in advance

from netcoreserver.

MrVitaly avatar MrVitaly commented on June 29, 2024

@ilsnk , @selmanahatli, @suleymanbyzt, do you have a stable way to reproduce it?

from netcoreserver.

chronoxor avatar chronoxor commented on June 29, 2024

It'll great if we can reproduce it and try to fix. I cannot reproduce this on my side. And we have WebSockets server on production running for months without issues.

from netcoreserver.

ilsnk avatar ilsnk commented on June 29, 2024

Maybe we are not using the server implementation correctly?
We have NetCoreServer acting as a socket, sending/receiving messages through our own abstract handlers.

from netcoreserver.

ilsnk avatar ilsnk commented on June 29, 2024

We can assume that the problem may be in this code.
Processing goes ProcessReceive is executed by asynchronous callback, lock is executed in OnRecieve. But since the callback (ProcessReceive) is executed from asynchronous callback code, by executing Resize we ignore the lock object

TspSession.cs:602,
WebSocket.cs:322

What do you think?

image_2024-03-24_03-08-27

from netcoreserver.

chronoxor avatar chronoxor commented on June 29, 2024

Still not reproduced on my side.

For each session receive buffer resize _receiveBuffer.Reserve(size + 1); should be called after OnReceived(_receiveBuffer.Data, 0, size) -> WebSocket.PrepareReceiveFrame(buffer, offset, size) -> lock (WsReceiveLock) { ... } is executed, so the buffer should be still valid in PrepareReceiveFrame.

from netcoreserver.

daigs avatar daigs commented on June 29, 2024

今天我也出现这个bug了,导致我的服务程序直接结束进程了.
我是刚开机时(服务程序加入了开机自动启动),马上打开浏览器通过网页请求我的服务出现问题的,
当时在网页上点击按钮请求服务时卡主了一会儿,然后我就使劲点了几下按钮继续请求,然后就弹出异常窗口后服务程序挂掉了...
然后我就重启我的服务程序,但是无论如何也出现不了这种异常了...
我重写了OnReceived如何用try...catch捕获异常,防止我的服务程序挂掉
image
image

from netcoreserver.

ilsnk avatar ilsnk commented on June 29, 2024

Perhaps due to an incorrect shift of payload bytes? I'm not sure what exactly the crash error is coming from, but is it worth rechecking this code?

payload = ((WsReceiveFrameBuffer[2] << 56) | (WsReceiveFrameBuffer[3] << 48) | (WsReceiveFrameBuffer[4] << 40) | (WsReceiveFrameBuffer[5] << 32) | (WsReceiveFrameBuffer[6] << 24) | (WsReceiveFrameBuffer[7] << 16) | (WsReceiveFrameBuffer[8] << 8) | (WsReceiveFrameBuffer[9] << 0));

image

from netcoreserver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.