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

Connect via UDP #19

Open
MatzHilven opened this issue Oct 11, 2023 · 9 comments
Open

Connect via UDP #19

MatzHilven opened this issue Oct 11, 2023 · 9 comments

Comments

@MatzHilven
Copy link

MatzHilven commented Oct 11, 2023

Is it possible to connect to carbon via UDP? (using this client of course)

@Serphentas
Copy link
Collaborator

I believe you can, but by default carbon.conf has that feature disabled:

ENABLE_UDP_LISTENER = False
UDP_RECEIVER_INTERFACE = 0.0.0.0
UDP_RECEIVER_PORT = 2003

However, this client uses LazySocket that calls for a normal Socket creation which is only TCP. Support for UDP would require a PR at this stage.

Are you able to submit such a change ? If not, I can look into it.

@MatzHilven
Copy link
Author

I'm not very experienced in js, but it looks like the net module has only got support for TCP clients. Seems like dgram would be good for this job?

@Serphentas
Copy link
Collaborator

That is correct, it's just a matter of calling the right type of socket within LazySocket, but this is outside the scope of this repo and I can only approve PRs here. Thus, I suggest we implement UDP support without dependencies as it's pretty straightforward.

I will think of a first draft to then use for tests and ping you when it's ready.

@MatzHilven
Copy link
Author

Perfect, thanks!

Serphentas added a commit that referenced this issue Oct 19, 2023
@Serphentas
Copy link
Collaborator

I just pushed the initial version with UDP support on the feat-udp branch. Can you pull it and try locally ?

You will also need to change the connect string: replace plaintext with udp. See README for an example.

@Serphentas
Copy link
Collaborator

Any updates @MatzHilven ? If it works well, I will merge into master.

@MatzHilven
Copy link
Author

I'll get you an answer this evening!

@Serphentas
Copy link
Collaborator

Shameless ping @MatzHilven :)

@MatzHilven
Copy link
Author

MatzHilven commented Apr 4, 2024

Sorry for the delay!!
LGTM 😊

Also: #20 (comment)

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