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

Fix winsock2 compatibility for libvncserver #185

Closed
wants to merge 3 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Jun 5, 2017

Replacing the data type for socket descriptors. Use the data type of the SOCKET to represent socket descriptors. Conditions for checking socket descriptors have been fixed in accordance with https://msdn.microsoft.com/ru-ru/library/windows/desktop/ms740516(v=vs.85).aspx . This fixes the bug #165 .
libvnc-win32
Note: IPv6 is disabled on Windows XP, so didn't create the IPv6 socket.
Note: You must add a firewall exception for port 5900. (Start -> Command palette -> Windows Firewall -> Exceptions)

@AlexiaChen
Copy link

OK , I tried to fix it like this way, all the same. but example.exe does not work fine. the other issue pops up , so, I gave it up.

@bk138
Copy link
Member

bk138 commented Jun 12, 2017

@AlexiaChen hint: it is not the data type, it is the handling of INVALID_SOCKET vs -1.

@bk138 bk138 closed this Jun 12, 2017
@bk138 bk138 reopened this Jun 12, 2017
@whm200410
Copy link

Hi lvorobjev.
The files you changed is not enough, there are other files that deal with socket(int) should be changed also.
Or, it will cause crash

@DaburLal
Copy link

Hello, Can i download the version of source codes before these changes were made?? if yes, then how ?? Thank you!

@whm200410
Copy link

whm200410 commented Jan 12, 2018 via email

@BastiaanOlij
Copy link
Contributor

I'm playing around with this as well. Applying the patch does fix the socket issues for me but I'm getting errors about incorrect size when trying to connect to any of the examples with a vnc client

@whm200410
Copy link

Did this patch check in?

@bk138
Copy link
Member

bk138 commented Mar 15, 2018

I plan to. I have a day job that takes a lot of time atm tough.

@alcz
Copy link

alcz commented Apr 28, 2018

FYI, using i've merged the changes from @whm200410 https://github.com/whm200410/libvncserver
while managing to keep git pull/push workflow and also patched the multi-threading listener mode too.

https://github.com/alcz/libvncserver/commits/master

Ligthly tested with current MSVC 2017. Probably it needs some further cleanup, at least to messy whitespaces in code, but I currently have no time to do it, sorry.

@whm200410
Copy link

whm200410 commented Apr 29, 2018 via email

@alcz
Copy link

alcz commented Apr 29, 2018

Instructions from @whm200410 are saying, you have to at least define LIBVNCSERVER_HAVE_LIBPTHREAD.
It's somewhat mentioned at https://github.com/whm200410/libvncserver/blob/master/README.md
HTH

@fdk17
Copy link

fdk17 commented May 16, 2018

While it indeed compiles and runs it appears to have other issues. When a client connects with the server, the server returns the wrong desktop size. Then the server will crash because there are still places where an invalid socket handle is used when closing the socket.

@alcz
Copy link

alcz commented May 23, 2018

@frodak17 Could kindly point out in the source code which specific lines have invalid socket type?
Let's say starting point of modifications are as follows:
master...alcz:master

You can mark specific lines like this:
https://github.com/alcz/libvncserver/blob/master/libvncserver/sockets.c#L105-L118

Without good feedback, it would be hard to fix anything. I've used this code with custom framebuffer (not the Windows desktop) and it behaving quite okay.

@tobydox
Copy link
Contributor

tobydox commented Oct 22, 2018

New attempt in #257

@tobydox
Copy link
Contributor

tobydox commented Dec 5, 2019

FYI: pthreads/mingw64 compatibility is available via #354

@bk138
Copy link
Member

bk138 commented Jan 9, 2020

Closing in favour of the more complete #257. But anyway, big thanks for a good starting point @lvorobyov 👍

@bk138 bk138 closed this Jan 9, 2020
@ghost ghost deleted the win32 branch October 6, 2024 08:43
@ghost ghost restored the win32 branch October 6, 2024 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants