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

Windows 10 compatibility #12

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

crystalgreen
Copy link

Hello again, here my 3nd pull request for the same changes. This time on the master branch as requested by @swells.
Neither the release 9.0.0 not the latest branch worked for me on Windows 10. I started investigating and finally found a fix, along with some other minor fixes (see commit messages).

The main issue I discovered was the following. When a child process is created, it fails to duplicate the socket with the incoming request.
This throws a 10038 socket error.
The reason is that the function WSADuplicateSocket is called in the child process but according to its doc
it must be called from the parent process.
This sample shows how to do it correctly. They used named pipes to transfer the socket infos to the child process. This is not very elegant as this could cause conflicts with the pipe name. So I used STDIN to communicate from parent to child, as is explained here.
It seems Windows 10 is more strict about socket duplication as it works on older Windows systems.
I tested my code on a Windows 7 PC and it worked there too.

CBA added 5 commits July 19, 2017 11:46
… ensure it works when path contains spaces.

When starting Rserve from within R, always pass the port as parameter.
Previously, it was not passed if port=6311. This led to use of the port 7004, the default port of Rserve.exe.
(Why is the default port no longer 6311 anyway?)
…in child but must be done in parent.

The child threw socket error 10038. Doc of WSADuplicateSocket states it must be called in parent process.
See also (here)[https://memset.wordpress.com/2010/10/13/win32-api-passing-socket-with-ipc-method/] on how to do it correctly and (here)[https://msdn.microsoft.com/en-us/library/windows/desktop/ms682499(v=vs.85).aspx] on how to use STDIN to talk to child process.
@crystalgreen
Copy link
Author

Hello, are you still interested in accepting my pull request?

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

Successfully merging this pull request may close these issues.

3 participants