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

Support DOOR32.SYS style socket descriptor sharing #175

Closed
NuSkooler opened this issue Mar 31, 2018 · 4 comments
Closed

Support DOOR32.SYS style socket descriptor sharing #175

NuSkooler opened this issue Mar 31, 2018 · 4 comments

Comments

@NuSkooler
Copy link
Owner

NuSkooler commented Mar 31, 2018

Modern Win32 and Linux doors often support only DOOR32.SYS and a shared socket descriptor for I/O. This is currently an issue in the Node.js world as socket descriptors cannot be shared. On Windows, a socket is required to be duplicated before being sent to a process as well.

To support this, some native support will need built in most likely. Something like:

  • Create socket
  • DuplicateHandle() on Windows to dupe socket FD (WSAXXX API requires PID to share to first, which we don't have)
  • Expose the duplicate handle FD to JavaScript side (e.g. to pass into DOOR32.SYS dropfile)
  • Read data from socket handle is emitted to JS side via data event
  • JS side can call write

Interesting resources:

@NuSkooler
Copy link
Owner Author

Would love any sort of help on this

@tracker1
Copy link

tracker1 commented Jun 25, 2018

Looks like you already referenced the thread[0] I found this[1] in...

[0] nodejs/node#7627
[1] https://github.com/clshortfuse/node-getsockethandleaddress

@NuSkooler
Copy link
Owner Author

@tracker1 Yeah, I think that's a dead end. Even if we have the descriptor, we can't just start doing I/O on the thing as it would throw the event system out of wack.

Perhaps a shim:
enig(stdio) <> shim.exe <> {shim.exe's shared fd} <> door

Where shim.exe would create a dropfile using enig's as a template or something.

@NuSkooler
Copy link
Owner Author

Finally got around to coding a solution to this. Introducing bivrost!. This utility will allow "bridging" between ENiGMA½'s shared socket server and a DOOR32.SYS style shared socket / file descriptor.

Added initial docs @ https://github.com/NuSkooler/enigma-bbs/blob/0.0.9-alpha/docs/modding/local-doors.md#shared-socket-descriptors

See bivrost! and ArakNet hooked up boards for releases. This is intended to work under Linux as well.

Closing this issue -- this and #163 should be good to go. If this doesn't work for you please log a new ticket here or in the bivrost! repo if it's a bug around that specifically.

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

No branches or pull requests

2 participants