We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
你好,我准备使用你这个组件来重构一个基于Tcp协议的日志收集Server。服务端读取数据是如下写的:
public override void SessionReceive(IServer server, SessionReceiveEventArgs e) { var pipeStream = e.Stream.ToPipeStream(); string name = pipeStream.ReadLine(); Console.WriteLine(name); base.SessionReceive(server, e); }
就是你Readme中的写法。
服务端采用的是BeetleX,客户端采用的是C# TcpClient对象,我发现如果我在发送数据的时候如果使用“\n”来分隔每条数据,那么服务端的ReadLine就无法正确读取,如果改成 '\r\n'才行,我猜测ReadLine内部应该使用了服务端运行环境的换行符(没看源码只是猜测)。以上测试环境均为Windows 10。
ReadLine
但是我现在有个需求就是部署在Linux下的API Gateway发送过来的日志数据每条的分隔符为'\n',我现在如何解决ReadLine这个问题呢。
The text was updated successfully, but these errors were encountered:
看了源码,原来你是写死了 “\r\n”
Sorry, something went wrong.
已解决 pipeStream.TryReadWith("\n", out var data, false)
pipeStream.TryReadWith("\n", out var data, false)
No branches or pull requests
你好,我准备使用你这个组件来重构一个基于Tcp协议的日志收集Server。服务端读取数据是如下写的:
就是你Readme中的写法。
服务端采用的是BeetleX,客户端采用的是C# TcpClient对象,我发现如果我在发送数据的时候如果使用“\n”来分隔每条数据,那么服务端的
ReadLine
就无法正确读取,如果改成 '\r\n'才行,我猜测ReadLine内部应该使用了服务端运行环境的换行符(没看源码只是猜测)。以上测试环境均为Windows 10。但是我现在有个需求就是部署在Linux下的API Gateway发送过来的日志数据每条的分隔符为'\n',我现在如何解决ReadLine这个问题呢。
The text was updated successfully, but these errors were encountered: