examples/GooglePull/googlepull.cpp
/*This is the best way to be notified of socket errors. C++ can't throw from a window procedure as it's in a different thread context than the main program. 
  expections work only within the a single thread context, not across thread boundries. That once worked, but only on 32bit verions of Windows. 
  As we no longer use 32 bit windows, this was the best solution I could think of, and in hindsight, it allows users to have their socket
  error handeling all in one convienent spot. 
*/
This is the best way to be notified of socket errors. C++ can't throw from a window procedure as it's in a different thread context than the main program.
expections work only within the a single thread context, not across thread boundries. That once worked, but only on 32bit verions of Windows.
As we no longer use 32 bit windows, this was the best solution I could think of, and in hindsight, it allows users to have their socket
error handeling all in one convienent spot.
This is the best way to be notified of socket errors . C ++ can ' t throw from a window procedure as it ' s in a different thread context than the main program . expections work only within the a single thread context not across thread boundries . That once worked but only on 32bit verions of Windows . As we no longer use 32 bit windows this was the best solution I could think of and in hindsight it allows users to have their socket error handeling all in one convienent spot .
void OnError(WSAException e) 
{
	try
	{
		std::wcout << e.what() << std::endl;
	}
	catch(std::exception ex) 
	{
		std::cout << ex.what() << std::endl;
	}
}
void OnError ( WSAException e ) { try { std :: wcout << e . what ( ) << std :: endl ; } catch ( std :: exception ex ) { std :: cout << ex . what ( ) << std :: endl ; } }
This is the best way to be notified of socket errors.
This is the best way to be notified of socket errors .
//can operator<< throw? Yes. Will it throw? Probably never when inserting C style strings, but better to be safe than sorry. 