01101001 01101110 01110100 00110010 01100101
email: [email protected]
the C# SDK for HP-Socket https://github.com/ldcsaa/HP-Socket
License: Apache License 2.0
01101001 01101110 01110100 00110010 01100101
email: [email protected]
HPSocket. Net code import unity project
Initialization TcpPackClient m_TcpPackClient = new TcpPackClient();
error:
DllNotFoundException: hpsocket4c assembly: type: member:(null)
HPSocket.Base.Client.CreateListener () (at E:/Project/HPSocket.Net/src/HPSocket.Net/Base/Client.cs:262)
HPSocket.Base.Client..ctor (HPSocket.Sdk.CreateListenerDelegate createListenerFunction, HPSocket.Sdk.CreateServiceDelegate createServiceFunction, HPSocket.Sdk.DestroyListenerDelegate destroyServiceFunction, HPSocket.Sdk.DestroyListenerDelegate destroyListenerFunction) (at E:/Project/HPSocket.Net/src/HPSocket.Net/Base/Client.cs:84)
HPSocket.Tcp.TcpClient..ctor (HPSocket.Sdk.CreateListenerDelegate createListenerFunction, HPSocket.Sdk.CreateServiceDelegate createServiceFunction, HPSocket.Sdk.DestroyListenerDelegate destroyServiceFunction, HPSocket.Sdk.DestroyListenerDelegate destroyListenerFunction) (at E:/Project/HPSocket.Net/src/HPSocket.Net/Tcp/TcpClient.cs:90)
HPSocket.Tcp.TcpPackClient..ctor () (at E:/Project/HPSocket.Net/src/HPSocket.Net/Tcp/TcpPackClient.cs:9)
TService.Initialization () (at Assets/Scripts/Runtime/Modules/Network/TCP/TService.cs:79)
TService..ctor (System.Boolean async) (at Assets/Scripts/Runtime/Modules/Network/TCP/TService.cs:44)
NetworkManager.Initialized () (at Assets/Scripts/Runtime/Manager/NetworkManager.cs:32)
When I use TcpPullAgent, call GetConnectionState() Back 6422588
code show as below:
LogHelper.WriteLog($"{_agent.GetConnectionState(connId).ToString()} connId = {connId}");
The print information is as follows:
6422588 connId = 1
Normally should show:
Connected connId = 1
Looking forward to your answer,thank you
开发框架:.NET CORE3.1
问题描述:
在Win10开发环境中,使用IClient连接服务失败会回调OnClose事件,但是在Docker下Centos7环境中不会回调
hi .
I get this error on line ( private readonly ITcpServer _server = new TcpServer();)
`
An unhandled exception of type 'System.DllNotFoundException' occurred in HPSocket.Net.dll
Additional information: Unable to load DLL 'hpsocket4c': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
`
I used WebSocket and did it according to WebSocketServer TestEcho. I wanted to provide a secure SSL connection, so I added the configuration items for the relevant certificates, as follows:
string url = "wss://0.0.0.0:16099";
IWebSocketServer Server = = new WebSocketServer(url);
Server.SslConfiguration = new SslConfiguration
{
FromMemory = false,
VerifyMode = SslVerifyMode.Peer,
//CaPemCertFileOrPath = "root.pem",
PemCertFile = "ssl-cert\eylin.cn.cer",
PemKeyFile = "ssl-cert\eylin.cn.key",
//KeyPassword = "123456",
};
Then I used WebSocketClient_TestEcho To connect "wss://test70.eylin.cn:16099"
When set to:
agent.SslConfiguration = new SslConfiguration
{
FromMemory = false,
VerifyMode = SslVerifyMode.None,
};
That is, without verifying the server certificate, it can connect and work correctly.
When set to:
agent.SslConfiguration = new SslConfiguration
{
FromMemory = false,
VerifyMode = SslVerifyMode.Peer,
};
That is, when verifying the server certificate, it cannot connect normally!
Then I tested on the webpage, Flutter, and other places but couldn't connect properly. I don't know why?
I can ensure that my certificate is correct because I built a WebSocket provided by SuperSocket using eylin.cn.jks and its password, which can work properly anywhere.
求个demo
Unhandled exception. System.DllNotFoundException: Unable to load shared library 'hpsocket4c' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libhpsocket4c: cannot open shared object file: No such file or directory
树莓派OS
can this be used to mimic epoll behaviour?
if so, what api's are capable of such?
udpclient正常连接、收发后,调用Dispose一直不返回
UDPClient 随机端口号可以正常连接,但通过 BindPort 绑定本地端口号,无法正常连接!why?
虽然我知道可以复制为项目文件,但是README没写。
"When running the HPSocket.net library on Raspberry Pi OS Lite 64bit ARM64 environment, the following error is encountered: 'Unable to load shared library 'hpsocket4c' or one of its dependencies. To assist in diagnosing loading problems, consider using a tool like strace. If you're using glibc, consider setting the LD_DEBUG environment variable.' Specific errors include:
/app/hpsocket4c.so: cannot open shared object file: No such file or directory.
/usr/lib/aarch64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /app/libhpsocket4c.so).
libhpsocket4c.so: cannot open shared object file: No such file or directory.
/app/hpsocket4c: cannot open shared object file: No such file or directory.
/app/libhpsocket4c: cannot open shared object file: No such file or directory.
How should this be resolved?"
How to send big data packets exceeding 100 megabytes
when websocket server send message,my websocketclient will occur this error:
The archive entry was compressed using an unsupported compression method
How do I set the following parameters?
1、SetSendPolicy(SP_DIRECT)
2、OnPrepareConnect / OnPrepareListen event set SYS_SSO_Nodelay(true)
thanks
I am in my project import HP-Socket.Net after, useing visual studio publish singe file application, resule displaying build fail.
The logs:
1>“GenerateBundle”任务意外失败。
1>System.ArgumentException: Invalid input specification: Found multiple entries with the same BundleRelativePath
1> 在 Microsoft.NET.HostModel.Bundle.Bundler.GenerateBundle(IReadOnlyList`1 fileSpecs)
1> 在 Microsoft.NET.Build.Tasks.GenerateBundle.ExecuteCore()
1> 在 Microsoft.NET.Build.Tasks.TaskBase.Execute()
1> 在 Microsoft.NET.Build.Tasks.TaskWithAssemblyResolveHooks.Execute()
1> 在 Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
1> 在 Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
========== 生成: 成功 0 个,失败 0 个,最新 8 个,跳过 0 个 ==========
========== 发布: 成功 0 个,失败 1 个,跳过 0 个 ==========
I create demo project for this purpose, recurrence the problem.
Demo: Test.zip
client.Connect()后,未连接成功,IsConnected也显示为true
大佬好,想请教个问题
断开连接时触发的OnMessage事件,如果不发送数据,会延迟5秒才断开连接,如果发送数据,则会立即断开。
这个是有什么说法吗?是必须要发送一个消息到客户端吗
DEMO的WebSocketServer-TestEcho可以复现这个问题
public HandleResult OnMessage(IWebSocketServer sender, IntPtr connId, bool final, OpCode opCode, byte[] mask, byte[] data)
{
Console.WriteLine($"OnMessage({connId}), final: {final}, op code: {opCode}, data length: {data.Length}");
//这里注释,不发送数据
//var ok = sender.Text(connId, $"这里只是一个欢迎页面, 只是欢迎您, 您可以连接到 {(sender.IsSecure ? "wss" : "ws")}://{sender.Uri.Host}:{sender.Uri.Port}/echo");
//return ok ? HandleResult.Ok : HandleResult.Error;
return HandleResult.Ok;
}
你好,想在server端配置wss,目前用的阿里云免费证书,可用类型有Tomcat、Apache 、Nginx、IIS、JKS,下载完之后没有.cer格式的证书,我应该下载使用哪个类型的证书呢,需要使用到nginx吗? 谢谢
server.SslConfiguration = new SslConfiguration
{
// 不从内存加载证书
FromMemory = false,
// ssl证书配置, 支持单向验证
VerifyMode = SslVerifyMode.Peer,
CaPemCertFileOrPath = "ssl-cert\\ca.crt",
PemCertFile = "ssl-cert\\server.cer",
PemKeyFile = "ssl-cert\\server.key",
KeyPassword = "123456",
};
ITcpServer<byte[]> server = new TcpServer<byte[]>
{
Address = 127.0.0.1,
Port = 8888,
DataReceiveAdapter = new HeadTailDataReceiveAdapter(),
};
server.OnPrepareListen += OnPrepareListen;
server.OnAccept += OnAccept;
server.OnParseRequestBody += OnParseRequestBody;
server.OnClose += OnClose;
server.OnShutdown += OnShutDown;
server.Start();
1、可以正常开启,在接收几条数据后,其中一个Server就会触发shutdown事件,看不到错误信息。 如果只开启一个Server就没问题。
2、客户端连接不同的Server端口,所有客户端ConnId是顺序下来的。这个ConnId生成规则是什么呀,有影响吗。
麻烦大佬指点一下,谢谢!
发布到linux上面,一直报 (段错误)
write(2, " -> [01] /root/MyWork/remotely/"..., 122 -> [01] /root/publish/libhpsocket4c.so : (HP_TcpServer_SetSocketBufferSize+0x43) [0x7f8b52ff1dd3]
) = 122
write(2, " -> [02] [0x7f8addebcb48]\n", 27 -> [02] [0x7f8addebcb48]
) = 27
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x5598a3c4487e} ---
rt_sigprocmask(SIG_UNBLOCK, [RT_2], NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [SEGV], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, [RT_2], NULL, 8) = 0
rt_sigaction(SIGSEGV, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f8b58a56630}, NULL, 8) = 0
unlink("/tmp/clr-debug-pipe-122880-287755908-in") = 0
unlink("/tmp/clr-debug-pipe-122880-287755908-out") = 0
unlink("/tmp/dotnet-diagnostic-122880-287755908-socket") = 0
rt_sigreturn({mask=[PIPE]}) = 69920
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x5598a3c4487e} ---
+++ killed by SIGSEGV (core dumped) +++
段错误
不知道怎么来解决这个问题。。希望能得到帮助。 谢谢。
websocket server 怎么得到客户端的远程IP,端口
用docker做成images后,启动报错
An assembly specified in the application dependencies manifest (WebApi.deps.json) was not found:
package: 'HPSocket.Net', version: '5.7.2'
path: 'runtimes/linux-x64/native/libhpsocket4c.so'
是不是.NET CORE平台开发的,在linux平台下的Docker打镜像不行,我用windows平台下的Docker打镜像可以
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.