U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ MT-multithreading and servers » TcpSocket in Array
TcpSocket in Array [message #37216] Thu, 06 September 2012 15:41 Go to previous message
Zbych is currently offline  Zbych
Messages: 332
Registered: July 2009
Senior Member
Hi,

In my application I would like to keep all open sockets in an Array. The problem is that when I add (or maybe I should say 'move') TcpSocket to Array and TcpSocket gets out of scope, program crashes. Destructor tries to call ssl->Close() and ssl pointer has value 1.

CONSOLE_APP_MAIN
{
	Array<TcpSocket> a;
	
	{	
		TcpSocket s;
		a.Add(s);
	}//<---- crash


	//rest of code that uses TcpSockets collected in Array
}


The question is how should I add TcpSockets to Array to avoid this error?
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Skylark logs failure in accept()
Next Topic: TcpSocket Tutorials exist?
Goto Forum:
  


Current Time: Thu May 07 10:26:09 GMT+2 2026

Total time taken to generate the page: 0.00626 seconds