Skip to content
New issue

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

Multiple multi-thread clients, one server #398

Open
nominalval opened this issue Oct 6, 2023 · 2 comments
Open

Multiple multi-thread clients, one server #398

nominalval opened this issue Oct 6, 2023 · 2 comments

Comments

@nominalval
Copy link

Hello.

Your library is great but it is safe threads and multiple clients?

Consider that you have 100+ clients send data on the same channel

SERVER:

ikcpcb *kcp1 = ikcp_create(0x11223344, (void*)0);

MULTIPLE multithreaded CLIENTS (100+) sending at high rate (maybe 1000 messages/sec):

ikcpcb *kcp1 = ikcp_create(0x11223344, (void*)0);

thread()
{
...
ikcp_send(kcp1, buffer, 8);
...
}

It is safe to do this?

I am interested in delivering text data as fast as possible. I don't care about the id and who sends. Client can have a random id, but i see that you have to specify it at server side.

Thank you.

@skywind3000
Copy link
Owner

it is a pure state machine (intentionally prevent calling any system api).

So apparently you should write thread-safe code yourself.

@nominalval
Copy link
Author

I will try to write this and share it after.

Where i can find some examples of server-client for C?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants