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

Viewer will not display any data #72

Closed
StefanS52u1 opened this issue Apr 29, 2021 · 4 comments
Closed

Viewer will not display any data #72

StefanS52u1 opened this issue Apr 29, 2021 · 4 comments
Labels

Comments

@StefanS52u1
Copy link

With windows computers, managed by our it, running with kasparsky and some other restriction policies, the viewer within the devstudio will never show profile data. After some research i found out, the there is a racing issue at the startup of server sockets and threads. The server will connect the auxiliary socket and send the initial magic number, but may not wait, until the client is ready to receive data. Therefore the client will not wake up any more (even at shutdown of the devstudio).
An additional sleep as workaround always helped to solve the issue:

	int server::connect_aux(unsigned short port)
		{
			sockaddr_in service = { AF_INET, htons(port), inet_addr(c_localhost), { 0 } };
			int s = static_cast<int>(::socket(AF_INET, SOCK_STREAM, IPPROTO_TCP));
			u_long arg = 1 /* nonblocking */;

			if (-1 == s)
				throw initialization_failed("aux socket creation failed");
			::ioctl(s, O_NONBLOCK, &arg);
			::connect(s, (sockaddr *)&service, sizeof(service));
			::_sleep(50);
			send_scalar(s, init_magic);
			return s;
		}
@tyoma tyoma added the defect label Apr 29, 2021
@tyoma
Copy link
Owner

tyoma commented Apr 29, 2021

Thank you, Stefan! I may add the sleep, but it doesn't look like long-term safe solution. I will be thinking on one, meanwhile, I push sleep() for the next release.

@tyoma
Copy link
Owner

tyoma commented May 2, 2021

Hi @StefanS52u1,
48497f6 fixes this bug - ::connect() is now done in blocking mode. Should work fine now (at least the tests didn't work and now do on Windows 2003).

@tyoma
Copy link
Owner

tyoma commented Jul 29, 2021

@StefanS52u1,

can you please clise this one?

thank you!

@StefanS52u1
Copy link
Author

Solved. Thanx.

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

No branches or pull requests

2 participants