Closed RoccoDevs closed 3 years ago
When does it happen? Are you accessing the connection after it's been disposed?
No the connections aren't disposed yet, so that's not the problem. I log whenever they get disposed and I can verify that way.
The server works like a relay or network switch. Some client A wants to message client B. The server mediates this a bit like signalR. And this error usually shows up more often when connections first come in. But also happens after that when traffic gets busy.
I committed a full copy of the code to github. If you would like to take a peek you can find it here: https://github.com/tomesendam/RelayServer.Benchmarking/blob/main/src/TheDesolatedTunnels.RelayServer.Core/Services/MessageSender.cs
It should be noted that this code is quite experimental at the moment.
I have to say, there is a certain harmony in having BedrockFramework next to TheDesolatedTunnels
@tomesendam Did you try loading the current src for Bedrock into your project and adding Conditional breakpoints right where it bombs out. You should get good stack details there.
@tomesendam Did you try loading the current src for Bedrock into your project and adding Conditional breakpoints right where it bombs out. You should get good stack details there.
I did not, I'll try that in a bit!
The naming is a pure coincidence 😂
I seem to have "fixed" the bug. I surrounded the code in TrySendAsync with a SemaphoreSlim
. It seems the SemaphoreSlim within bedrock's WriteAsync
wasn't enough? But I'm just learning about all of this. I honestly don't know why it fixed it. I assumed bedrock's semaphore would be enough. @davidfowl If you have time I would like to know why if you do know!
Odd that the semaphore in the protocol writer isn't enough.
Odd that the semaphore in the protocol writer isn't enough.
Yes it is. You have no idea what's going wrong either?
I'm currently working on a server using bedrock. And I've been hitting a weird bug where I get one of the two following errors:
or:
I've tried a lot, but I'm out of luck I guess. But it really seems to be a bug inside of bedrock and not my code. Hence why I'm submitting this as an issue. Hope someone knows what's up! I have the source code on github. Feel free to take a peek