Closed fieldsye closed 4 years ago
可以先把grpc和tcp转发的配置给注释掉然后在运行。
Thanks for your quickly response! the JT808.Gateway.SimpleServer can run after comment the grpc in Program.cs, even there is fail as below.
~/dotnet/JT808Gateway/simples/JT808.Gateway.SimpleServer# dotnet run dbug: Microsoft.Extensions.Hosting.Internal.Host[1] Hosting starting info: JT808TcpServer[0] JT808 TCP Server start at 0.0.0.0:808. info: JT808TcpReceiveTimeout[0] [Check Receive Timeout] info: JT808TcpReceiveTimeout[0]
info: JT808UdpServer[0] JT808 Udp Server start at 0.0.0.0:808. info: JT808UdpReceiveTimeout[0] [Check Receive Timeout] info: JT808UdpReceiveTimeout[0]
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]
Content root path: /root/dotnet/JT808Gateway/simples/JT808.Gateway.SimpleServer/bin/Debug/netcoreapp3.1/
dbug: Microsoft.Extensions.Hosting.Internal.Host[2]
Hosting started
fail: JT808TransmitService[0]
初始化配置链接远程服务端all_127.0.0.1:20000,链接异常:System.Net.Internals.SocketExceptionFactory+ExtendedSocketException (111): Connection refused 127.0.0.1:20000
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(Exception source)
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
at System.Net.Sockets.Socket.<>c.
info: JT808TcpServer[0]
dbug: JT808TcpServer[0]
trce: JT808TcpServer[0]
dbug: JT808NormalReplyMessageHandlerImpl[0] 可以自定义添加一些东西:上下行日志、数据转发 dbug: JT808SessionNoticeService[0] JT808SessionOnline-11111111111 dbug: JT808MsgLogging[0] up-11111111111-7E010000310111111111110001000000004B6F696B653030314B6F696B653030313030303030303030303030304B6F696B6530303102D4C1413132333435347E dbug: JT808MsgLogging[0] down-11111111111-7E8100000F01111111111100010001004A3131313131313131313131E57E dbug: JT808TcpServer[0]
trce: JT808TcpServer[0]
dbug: JT808NormalReplyMessageHandlerImpl[0] 可以自定义添加一些东西:上下行日志、数据转发 dbug: JT808MsgLogging[0] up-11111111111-7E01020004011111111111000231323334117E dbug: JT808MsgLogging[0] down-11111111111-7E8001000501111111111100020002010200977E dbug: JT808TcpServer[0]
trce: JT808TcpServer[0]
dbug: JT808NormalReplyMessageHandlerImpl[0]
可以自定义添加一些东西:上下行日志、数据转发
dbug: JT808MsgLogging[0]
up-11111111111-7E0200001C0111111111110003000000050000000A0001ADB0000186A000320032001E200529200220297E
dbug: JT808NormalReplyMessageHandlerImpl[0]
重写自带Msg0x0200的消息
dbug: JT808MsgLogging[0]
down-11111111111-7E8001000501111111111100030003020000967E
^Cinfo: Microsoft.Hosting.Lifetime[0]
Application is shutting down...
dbug: Microsoft.Extensions.Hosting.Internal.Host[3]
Hosting stopping
info: JT808UdpServer[0]
808 Udp Server Stop
fail: JT808UdpServer[0]
Received Bytes
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.
at System.Net.Sockets.Socket.EndReceiveMessageFrom(IAsyncResult asyncResult, SocketFlags& socketFlags, EndPoint& endPoint, IPPacketInformation& ipPacketInformation)
at System.Net.Sockets.Socket.<>c.
1.这个错误是因为需要打开另外一个tcp的服务器来接收808转发过来的数据,没有这个tcp的服务器他就会报错,但是自动几秒内自行重连,这个错误是可以忽略的; 2.Application is shutting down...再应用程序关闭的时候,可能由于Udp的服务还在接收打开的状态,但是socket已经释放了,所以才会报错,这个错误也可以忽略,但是可以改进这个错误; 3.不好意思,我没有Ubuntu 18.04 的系统,但是我再centos7下面添加grpc后也是正常运行的。
Dears,
Great project,now I can build this project on Ubuntu arm64 platform, but encounter below error when I run the JT808.Gateway.SimpleServer, could you give me some help or hints to fix it, sorry for this naive problem.
bin/Debug/netcoreapp3.1/JT808.Gateway.SimpleServer dbug: Microsoft.Extensions.Hosting.Internal.Host[1] Hosting starting info: JT808TcpServer[0] JT808 TCP Server start at 0.0.0.0:808. info: JT808TcpReceiveTimeout[0] [Check Receive Timeout] info: JT808TcpReceiveTimeout[0]
info: JT808UdpServer[0] JT808 Udp Server start at 0.0.0.0:808. info: JT808UdpReceiveTimeout[0] [Check Receive Timeout] info: JT808UdpReceiveTimeout[0]
fail: JT808TransmitService[0] 初始化配置链接远程服务端all_127.0.0.1:20000,链接异常:System.Net.Sockets.SocketException (111): Connection refused at System.Net.Sockets.Socket.BeginConnectEx(EndPoint remoteEP, Boolean flowContext, AsyncCallback callback, Object state) at System.Net.Sockets.Socket.UnsafeBeginConnect(EndPoint remoteEP, AsyncCallback callback, Object state, Boolean flowContext) at System.Net.Sockets.Socket.BeginConnect(EndPoint remoteEP, AsyncCallback callback, Object state) at System.Net.Sockets.Socket.ConnectAsync(EndPoint remoteEP) at JT808.Gateway.Transmit.JT808TransmitService.InitRemoteServsers() Unhandled exception. System.IO.IOException: Error loading native library "/root/dotnet/JT808Gateway/simples/JT808.Gateway.SimpleServer/bin/Debug/netcoreapp3.1/runtimes/linux/native/libgrpc_csharp_ext.x64.so". at Grpc.Core.Internal.UnmanagedLibrary..ctor(String[] libraryPathAlternatives) at Grpc.Core.Internal.NativeExtension.LoadUnmanagedLibrary() at Grpc.Core.Internal.NativeExtension.LoadNativeMethods() at Grpc.Core.Internal.NativeExtension..ctor() at Grpc.Core.Internal.NativeExtension.Get() at Grpc.Core.Internal.NativeMethods.Get() at Grpc.Core.GrpcEnvironment.GrpcNativeInit() at Grpc.Core.GrpcEnvironment..ctor() at Grpc.Core.GrpcEnvironment.AddRef() at Grpc.Core.Server..ctor(IEnumerable`1 options) at Grpc.Core.Server..ctor() at JT808.Gateway.JT808GrpcServer.StartAsync(CancellationToken cancellationToken) at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken) at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token) at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token) at JT808.Gateway.SimpleServer.Program.Main(String[] args) in /root/dotnet/JT808Gateway/simples/JT808.Gateway.SimpleServer/Program.cs:line 61 at JT808.Gateway.SimpleServer.Program.(String[] args)
Aborted (core dumped)