Git Product home page Git Product logo

hpsocket.net's Introduction

hpsocket.net's People

Contributors

gao996 avatar int2e avatar janchou avatar ldcsaa avatar leechee777 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hpsocket.net's Issues

HPSocket. Net code import unity project Error

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)

error-154404

_agent.GetConnectionState(connId) result 6422588

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

error on private readonly ITcpServer _server = new TcpServer();

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)
`

When WebSocket uses SSL, the client cannot connect properly

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.

arm 下无法加载libhpsocket4c

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

epoll

can this be used to mimic epoll behaviour?

if so, what api's are capable of such?

"The HPSocket.net library throws an error when running on Raspberry Pi OS Lite 64bit ARM64 environment."

"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?"

SYS_SSO_Nodelay & setsendpolicy

How do I set the following parameters?
1、SetSendPolicy(SP_DIRECT)
2、OnPrepareConnect / OnPrepareListen event set SYS_SSO_Nodelay(true)

thanks

In .net5 enabled "PublishSingleFile" result in build fail

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

断开连接触发的OnMessage事件,如果直接返回HandleResult.Ok会有延迟

大佬好,想请教个问题

断开连接时触发的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;

    }

WebSocket配置SSL证书的问题

你好,想在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",
                    };

一个程序开启两个不同端口的TcpServer,其中一个会shutdown。

        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生成规则是什么呀,有影响吗。

麻烦大佬指点一下,谢谢!

Error message: Core dumped

发布到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) +++
段错误

不知道怎么来解决这个问题。。希望能得到帮助。 谢谢。

用docker做成images后无法启动

用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打镜像可以

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.