Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Program didn't exit in Task Manager after click [X]
Re: Program didn't exit in Task Manager after click [X] [message #55403 is a reply to message #55402] Sat, 07 November 2020 14:03 Go to previous messageGo to previous message
peterh is currently offline  peterh
Messages: 108
Registered: November 2018
Location: Germany
Experienced Member
I have tracked down this by singlestep to some degree:

Core, Socket.cpp
Comments starting "//!!!" are by me.

bool TcpSocket::Accept(TcpSocket& ls)
{
	Close();
	Init();
	Reset();
	ASSERT(ls.IsOpen());
	int et = GetEndTime();
	for(;;) {
		int h = ls.GetTimeout();
		bool b = ls.Timeout(timeout).Wait(WAIT_READ, et);
		ls.Timeout(h); //!!! If I step into this thread is switched, the window appears and I am unable to step further
		if(!b) // timeout
			return false;
		socket = accept(ls.GetSOCKET(), NULL, NULL);
		if(socket != INVALID_SOCKET)   
			break;
		if(!WouldBlock() && GetErrorCode() != SOCKERR(EINTR)) { // In prefork condition, Wait is not enough, as other process can accept
			SetSockError("accept");
			return false;
		}
	}
	mode = ACCEPT;
	return SetupSocket();
}


Im unable to singlestep this somewhere inside this code there happens a threadswitch and the window appears.
This blocks the thread. The problem could be here.
I admit, I dont understand it fully have no clue about Networking code. Embarassed

So far I found, timeout in the socket is set to zero or negative - maybe uninitialized - , this means infinite timeout or blocking, so this is a problem in the user code.
I am not sure about it.

[Updated on: Sat, 07 November 2020 21:06]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: report generator
Next Topic: Pie Chart in U++?
Goto Forum:
  


Current Time: Thu May 16 05:50:12 CEST 2024

Total time taken to generate the page: 0.02822 seconds