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

Winsock implementation #453

Open
JayFoxRox opened this issue Apr 11, 2021 · 2 comments
Open

Winsock implementation #453

JayFoxRox opened this issue Apr 11, 2021 · 2 comments

Comments

@JayFoxRox
Copy link
Member

JayFoxRox commented Apr 11, 2021

(I'm very sure we discussed this in the past, but I'm unable to find anything when searching for "winsock" on this repository; please close if I missed an existing issue)

I had started a rather dummy ws2_32.lib implementation about a year ago and I believe @thrimbor had also worked on something in that direction?
A real implementation would be nice, but a partially working dummy is also fine with me, just to get the ball rolling.

Specifically, my winsock was exclusively meant for enet, and it can be found here: JayFoxRox#84.
At the time of writing, the latest version is in JayFoxRox@f3dd888.
I don't think I ever really tested it, so it's probably non-functional.

It would be nice if someone could find a suitable implementation or clean up the mess from my commit.
Consider my code in that commit to be in public domain (feel free to steal code or relicense as whatever).
More formally: I also license that code under CC0.

@ReenigneArcher
Copy link
Contributor

I would like this as well as I would like to use enet (fork from https://github.com/cgutman/enet/tree/moonlight) in a project I'm attempting. I had a look at your previous attempt, but for now it's a bit above my head to get to a working state.

I was wondering if it might be easier to compile enet as UNIX instead of WIN32, and then re-implement the required parts from the Linux source. It'd still be above my head, but maybe it's easier since it's open source.

@JayFoxRox
Copy link
Member Author

The use of WSASendMsg in that fork is probably problematic. It is used at least in cgutman/enet@e790647#diff-14d02ab34000ddb786c1258055d552d6b6613c608e2e515096fdc8abe26e9e90R474
It's rather advanced and I'm not sure if lwip (or my code) supports it - I doubt it. It's mostly relevant for multiple network addresses, application specific routing (like tracing) or IPv6.
You could probably implement some WSASendMsg which just ignores some fields (for now).

Aside from that, the UNIX and WIN32 code-path should only differ slightly. Typically WIN32 networking only adds winsock specific init and cleanup and some utility functions related to timing or buffer allocations - all of which nxdk probably already supports.

I don't remember, but my winsock implementation probably also merely stubs the init/cleanup and hooks up the Winsock BSD-style socket API to the lwip BSD-style socket interface.

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

No branches or pull requests

2 participants