Comments (3)
aah ok, I understand the issue. Will fix it soon!
from netcoreserver.
You can use OptionReceiveBufferSize
and OptionSendBufferSize
options in Client/Session for your case:
// Prepare receive & send buffers
_receiveBuffer.Reserve(OptionReceiveBufferSize);
_sendBufferMain.Reserve(OptionSendBufferSize);
_sendBufferFlush.Reserve(OptionSendBufferSize);
from netcoreserver.
I'v seen this code. but the problem is,
these value are using Socket.ReceiveBufferSize and Socket.SendBufferSize, when SslSession is created, the Socket object is not there.
The socket was given in Connect method, in the same method, buffer Reserved.
There is no chance to set OptionReceiveBufferSize before Buffer.Reserve was called.
public int OptionReceiveBufferSize
{
get => Socket.ReceiveBufferSize;
set => Socket.ReceiveBufferSize = value;
}
.....
.....
internal void Connect(Socket socket)
{
Socket = socket;
// Update the session socket disposed flag
IsSocketDisposed = false;
// Setup buffers
_receiveBuffer = new Buffer();
_sendBufferMain = new Buffer();
_sendBufferFlush = new Buffer();
// Apply the option: keep alive
if (Server.OptionKeepAlive)
Socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.KeepAlive, true);
// Apply the option: no delay
if (Server.OptionNoDelay)
Socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.NoDelay, true);
// Prepare receive & send buffers
_receiveBuffer.Reserve(OptionReceiveBufferSize);
_sendBufferMain.Reserve(OptionSendBufferSize);
_sendBufferFlush.Reserve(OptionSendBufferSize);
from netcoreserver.
Related Issues (20)
- OnDisconneting after send data HOT 1
- IndexOutOfRangeException in WebSocket Server HOT 1
- Cross threading problem reporting tcpSession data to UI HOT 4
- PlayStation 3 Client - SSL connection impossible with HTTPS protocol.
- OnDisconnected without OnConnected? HOT 2
- use wssclient for binance websocket will disconnect when sending ping package
- Question on SSLContext usage
- Performance of UDP echo server
- Why the cache is not updated? HOT 7
- Add cache to the parent directory of index.html in InsertPathInternal? HOT 2
- Fix Bug: .NetFramework 4.8 ClientWebSocket Cann't Connect To .Net8 WsSession HOT 1
- Unhandled exception in WebSocket HOT 12
- Serialize and Deserialze HOT 3
- SimpleW : a RestAPI above NetCoreServer [not an issue but a library using NetCoreServer] HOT 1
- SslClient does not work in release mode
- Feature-Request: use BufferManager and SocketAsyncEventArgsPool to optimize memory
- netcoreserver is missing NuGet package README file
- WSS on Blazor WASM .NET 8
- 发送消息过快导致部分消息偶尔无法接受到 HOT 2
- Buffer-size in the 'OnReceived' methods can get too long HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from netcoreserver.