newlifex / newlife.net Goto Github PK
View Code? Open in Web Editor NEW单机吞吐2266万tps的网络通信框架
License: MIT License
单机吞吐2266万tps的网络通信框架
License: MIT License
It's called Net , but lack some micro services, such as MQTT 、websocket, do you have plan to implement these in the future ?
`//发送方
var TcpClient = new NetUri($"tcp://{remoteIP}:{remotePort}");
var Netclient = TcpClient.CreateRemote();
Netclient.Add();//GitHub上看不到 StandardCodec
Netclient.Open();
while (data.Length > offset)
{
……
var pk = new Packet(sendData);
Netclient.SendMessage(pk);
}
//接收方
var server = new NetServer
{
……
}
server.Add();//GitHub上看不到 StandardCodec
server.Received += (x, y) =>
{
……
}
server.Start();`
请问如何保证接收的顺序和发送的顺序是一样的?现在是接收的时候,包的顺序不是按照发送的顺序接收的。
用的阿里云的服务,域名连接字符串,高并发压测环境下 会经常出现超时
at NewLife.Caching.RedisClient.GetStream(Boolean create)\n at NewLife.Caching.RedisClient.ExecuteCommand(String cmd, Packet[] args, Object[] oriArgs)\n at NewLife.Caching.RedisClient.Execute(String cmd, Object[] args)\n at NewLife.Caching.RedisClient.Execute[TResult](String cmd, Object[] args)\n at NewLife.Caching.Redis.<>c__DisplayClass87_01.<Get>b__0(RedisClient rds)\n at NewLife.Caching.Redis.Execute[TResult](String key, Func
2 func, Boolean write)\n at NewLife.Caching.Redis.Get[T](String key)\n at payfun.qrcode.http.RedisCache.GetObjectAsync[T](String key) in /home/gitlab-runner/builds/ttof6qJ6/0/ad/payfun.qrcode.http/library/ICache.cs:line 119\n at payfun.qrcode.http.CacheChell.GetObjectAsync[T](ICache cache, String key, Func`1 func, Int32 expireSeconds)
使用NewLife.Net时遇到一个问题
我和客户端约定,第一次请求的时候带上文件名和文件长度,然后发送文件流。现在这个Received每次都会被触发,我的本意是类似原生socket那样,我可以一直Receive,直到达到约定文件长度结束(如图)。
while(headerBUffer.Length>size){ byte[] buff=new byte[1024]; int num=socket.Receive(buff); if(num>0) { //…… } }
比如用户提交一个10M的文件,第一次请求的时候带上了文件名和文件长度,我现在在NewLife.Net的server.Received中没办法实现那个一直接收的动作,只能每次数据来触发一次这个事件。
这样就导致了我后面接收的不知道一开始请求的那个文件名是什么(我现在用一个静态字典来维护,觉得不是太好)
可能与wpf本身框调有关,调试源码时是有信息返回的,并未报出任何错误。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.