Example #1
0
void ApnsService::Stop()
{
	if (!stopped_)
	{
		stopped_ = true;

		StopAllTimer();

		int num_apnsconn = apns_conns_.size();
		for (int i = 0; i < num_apnsconn; ++i)
		{
			apns_conns_[i]->Close();
		}
		io_service_->stop();
	}
}
Example #2
0
/*
 * Generalized error function. It can be called the same way that printf() can.
 *
 * @format format with the same meaning as in printf
 */
void exitOnError(const char *format, ...)
{
  char s[1024];

  va_list argList;
  
  va_start(argList, format);
  vsprintf( s, format, argList);
  va_end(argList);
  
  #ifdef WIN32
    StopAllTimer();
    MessageBox( NULL, s, "Exit on Error", MB_OK );
  #else
    printf("ERROR: ");
    printf( s );
    printf("\nRARS terminated!\n");
  #endif 
  
  exit(1);
}