void stopSourceAndUnQueueBuffers(const ALuint& source)
 {
   ALint state;
   alGetSourcei(source,AL_SOURCE_STATE,&state) ;
   if (state == AL_PLAYING)
   {
     alSourceStop(source) ;
     ALenum error = alGetError() ; 
     if (error != AL_NO_ERROR)
     {
       ErrorMessage("[OpenAL::OggReader] " + getErrorString(error)) ;
     }
   }
   
   ALint queue_size = 0 ;
   alGetSourcei(source,AL_BUFFERS_QUEUED,&queue_size) ;
   ALenum error = alGetError() ; 
   if (error != AL_NO_ERROR)
   {
     ErrorMessage("[OpenAL::OggReader] " + getErrorString(error)) ;
   }
   else
   {
     ALuint* buffers = new ALuint[std::max(0,queue_size)];
     alSourceUnqueueBuffers(source,queue_size,buffers) ;
     error = alGetError() ; 
     if (error != AL_NO_ERROR)
     {
       ErrorMessage("[OpenAL::OggReader] " + getErrorString(error)) ;
     }
     delete[] buffers ;
   }
 }
Example #2
0
void Program::destroy()
{
    GLuint glError;

    for(size_t i = 0; i < mShaders.size(); ++i)
    {
        glDetachShader(mHandle, dynamic_cast<Shader *>(mShaders[i])->getHandle());
        glError = glGetError();

        if (glError != GL_NO_ERROR)
        {
            std::cerr << "Error detaching shader " << getErrorString(glError).c_str() << std::endl;
        }

        dynamic_cast<Shader *>(mShaders[i])->detach();
    }

    mShaders.clear();

    glDeleteProgram(mHandle);
    glError = glGetError();

    if (glError != GL_NO_ERROR)
    {
        std::cerr << "Error deleting program" << getErrorString(glError).c_str() << std::endl;
    }
}
Example #3
0
static void makeContextCurrent(_GLFWwindow* window)
{
    if (window)
    {
        if (!eglMakeCurrent(_glfw.egl.display,
                            window->context.egl.surface,
                            window->context.egl.surface,
                            window->context.egl.handle))
        {
            _glfwInputError(GLFW_PLATFORM_ERROR,
                            "EGL: Failed to make context current: %s",
                            getErrorString(eglGetError()));
            return;
        }
    }
    else
    {
        if (!eglMakeCurrent(_glfw.egl.display,
                            EGL_NO_SURFACE,
                            EGL_NO_SURFACE,
                            EGL_NO_CONTEXT))
        {
            _glfwInputError(GLFW_PLATFORM_ERROR,
                            "EGL: Failed to clear current context: %s",
                            getErrorString(eglGetError()));
            return;
        }
    }

    _glfwPlatformSetCurrentContext(window);
}
Example #4
0
// Initialize EGL
//
int _glfwInitContextAPI(void)
{
    if (!_glfwInitTLS())
        return GL_FALSE;

    _glfw.egl.display = eglGetDisplay((EGLNativeDisplayType)_GLFW_EGL_NATIVE_DISPLAY);
    if (_glfw.egl.display == EGL_NO_DISPLAY)
    {
        _glfwInputError(GLFW_API_UNAVAILABLE,
                        "EGL: Failed to get EGL display: %s",
                        getErrorString(eglGetError()));
        return GL_FALSE;
    }

    if (!eglInitialize(_glfw.egl.display,
                       &_glfw.egl.versionMajor,
                       &_glfw.egl.versionMinor))
    {
        _glfwInputError(GLFW_API_UNAVAILABLE,
                        "EGL: Failed to initialize EGL: %s",
                        getErrorString(eglGetError()));
        return GL_FALSE;
    }

    if (_glfwPlatformExtensionSupported("EGL_KHR_create_context"))
        _glfw.egl.KHR_create_context = GL_TRUE;

    return GL_TRUE;
}
Example #5
0
bool
EGLDevice::attachWindow(GnashDevice::native_window_t window)
{
    GNASH_REPORT_FUNCTION;
    
    if (!window) {
        throw GnashException("bogus window handle!");
    } else {
        _nativeWindow = static_cast<EGLNativeWindowType>(window);
    }

    if (_eglSurface != EGL_NO_SURFACE) {
        eglDestroySurface(_eglDisplay, _eglSurface);
    }
    
    log_debug("Initializing EGL Surface");
    if (_eglDisplay && _eglConfig) {
        _eglSurface = eglCreateWindowSurface(_eglDisplay, _eglConfig,
                                             _nativeWindow, surface_attributes);
    }
    
    if (EGL_NO_SURFACE == _eglSurface) {
        log_error("eglCreateWindowSurface failed (error %s)", 
                  getErrorString(eglGetError()));
    } else {
        printEGLSurface(_eglSurface);
    }
    
    // step5 - create a context
    _eglContext = eglCreateContext(_eglDisplay, _eglConfig, EGL_NO_CONTEXT, NULL);
    if (EGL_NO_CONTEXT == _eglContext) {
        // At least on Ubuntu 10.10, this returns a successful error string
        // with LibeMesa's OpenVG 1.0 implementation. With OpenVG 1.1 on
        // an ARM board, this works fine. Even the libMesa examples fail
        // the same way.
        boost::format fmt = boost::format(
                             _("eglCreateContext failed (error %s)")
                                           ) % getErrorString(eglGetError());
        throw GnashException(fmt.str());
    } else {
        printEGLContext(_eglContext);
    }
    
    // step6 - make the context and surface current
    if (EGL_FALSE == eglMakeCurrent(_eglDisplay, _eglSurface, _eglSurface, _eglContext)) {
        // If for some reason we get a context, but can't make it current,
        // nothing else will work anyway, so don't continue.
        boost::format fmt = boost::format(
                             _("eglMakeCurrent failed (error %s)")
                                           ) % getErrorString(eglGetError());
        throw GnashException(fmt.str());
    }       // begin user code

    return true;
}   
Example #6
0
bool checkGL(const char* format, ...)
{
  GLenum error = glGetError();
  if (error == GL_NO_ERROR)
    return true;

  va_list vl;
  char* message;
  int result;

  va_start(vl, format);
  result = vasprintf(&message, format, vl);
  va_end(vl);

  if (result < 0)
  {
    logError("Error formatting error message for OpenGL error %u", error);
    return false;
  }

  logError("%s: %s", message, getErrorString(error));

  std::free(message);
  return false;
}
Example #7
0
void HttpEngine::dataCycle(bool bChunked)
{
	bool bOK = true;
	do
	{
		m_nTransfered = 0;
		
		if(bChunked)
		{
			QString line;
			do
			{
				line = readLine();
			}
			while(line.trimmed().isEmpty());
			
			m_nToTransfer = line.toULongLong(0,16);
			if(!m_nToTransfer)
				break;
		}
		
		while(!m_bAbort && (m_nTransfered < m_nToTransfer || !m_nToTransfer))
		{
			if(! (bOK = readCycle()))
			{
				if(m_nToTransfer != 0)
					throw getErrorString(m_pRemote->error());
				break;
			}
		}
	}
	while(bChunked && bOK && !m_bAbort);
}
Example #8
0
void HttpEngine::processServerResponse()
{
	QByteArray response;
	
	while(true)
	{
		QByteArray line = readLine();
		
		if(line.size() <= 2)
		{
			if(line.isEmpty())
				throw getErrorString(m_pRemote->error());
			else
				break;
		}
		else
			response += line;
	}
	
	QHttpResponseHeader header = QHttpResponseHeader(QString(response));
	
	if(!m_bUpload)
		handleDownloadHeaders(header);
	else
		handleUploadHeaders(header);
}
Example #9
0
bool Socket::connectToServer(const String& address, Uint16 port, float timeout){
	init();

	Timer time;

	SOCKADDR_IN serverAddr;
	if(initAddress(serverAddr, address, port, true) == false){
		WT_THROW("%s", getErrorString().c_str());
	}

	int res = SOCKET_ERROR;

	time.reset();
	while(timeout < 0.0f || time.getSeconds() < timeout){
		res = connect(mSocket, (SOCKADDR*)&serverAddr, sizeof(SOCKADDR));

		if(res != SOCKET_ERROR){
			mServerAddr = serverAddr;
			return true;
			break;
		}
	}

	return false;
}
Example #10
0
void 
OMXMLReaderExpat::endElementHandler(const XML_Char* name)
{
    TRACE("OMXMLReaderExpat::endElementHandler");

    wchar_t* workBuffer = getWorkBuffer(xmlStringLen(name) + 1);
    OMUInt32 strLen = readCharacters(workBuffer, name, NAMESPACE_SEPARATOR);
    _uri = workBuffer;

    if (strLen > 0)
    {
        strLen = readCharacters(workBuffer, &(name[strLen + 1]), 0);
    }
    else
    {
        strLen = readCharacters(workBuffer, &(name[strLen]), 0);
    }
    _localName = workBuffer;

    XML_Status status = XML_StopParser(_parser, true);
    if (status != XML_STATUS_OK)
    {
        XML_Error errorCode = XML_GetErrorCode(_parser);
        if (errorCode != XML_ERROR_SUSPENDED)
        {
            throw OMException(getErrorString());
        }
    }

    registerEvent(END_ELEMENT);
}
Example #11
0
// static
void LLAssetStorage::uploadCompleteCallback(const LLUUID& uuid, void *user_data, S32 result, LLExtStat ext_status) // StoreAssetData callback (fixed)
{
	if (!gAssetStorage)
	{
		llwarns << "LLAssetStorage::uploadCompleteCallback has no gAssetStorage!" << llendl;
		return;
	}
	LLAssetRequest	*req	 = (LLAssetRequest *)user_data;
	BOOL			success  = TRUE;

	if (result)
	{
		llwarns << "LLAssetStorage::uploadCompleteCallback " << result << ":" << getErrorString(result) << " trying to upload file to upstream provider" << llendl;
		success = FALSE;
	}

	// we're done grabbing the file, tell the client
	gAssetStorage->mMessageSys->newMessageFast(_PREHASH_AssetUploadComplete);
	gAssetStorage->mMessageSys->nextBlockFast(_PREHASH_AssetBlock);
	gAssetStorage->mMessageSys->addUUIDFast(_PREHASH_UUID, uuid);
	gAssetStorage->mMessageSys->addS8Fast(_PREHASH_Type, req->getType());
	gAssetStorage->mMessageSys->addBOOLFast(_PREHASH_Success, success);
	gAssetStorage->mMessageSys->sendReliable(req->mHost);

	delete req;
}
Example #12
0
void _glfwPlatformMakeContextCurrent(_GLFWwindow* window)
{
    if (window)
    {
        if (window->egl.surface == EGL_NO_SURFACE)
        {
            window->egl.surface = eglCreateWindowSurface(_glfw.egl.display,
                                                         window->egl.config,
                                                         (EGLNativeWindowType)_GLFW_EGL_NATIVE_WINDOW,
                                                         NULL);
            if (window->egl.surface == EGL_NO_SURFACE)
            {
                _glfwInputError(GLFW_PLATFORM_ERROR,
                                "EGL: Failed to create window surface: %s",
                                getErrorString(eglGetError()));
            }
        }

        eglMakeCurrent(_glfw.egl.display,
                       window->egl.surface,
                       window->egl.surface,
                       window->egl.context);
    }
    else
    {
        eglMakeCurrent(_glfw.egl.display,
                       EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
    }

    _glfwSetCurrentContext(window);
}
Example #13
0
void _glfwInputError(int error, const char* format, ...)
{
    if (_glfwErrorCallback)
    {
        char buffer[16384];
        const char* description;

        if (format)
        {
            int count;
            va_list vl;

            va_start(vl, format);
            count = vsnprintf(buffer, sizeof(buffer), format, vl);
            va_end(vl);

            if (count < 0)
                buffer[sizeof(buffer) - 1] = '\0';

            description = buffer;
        }
        else
            description = getErrorString(error);

        _glfwErrorCallback(error, description, _glfwErrorCallback_data);
    }
}
Example #14
0
void ConnectFriendWizard::setCertificate(const QString &certificate, bool friendRequest)
{
	if (certificate.isEmpty()) {
		setStartId(Page_Intro);
		return;
	}

	uint32_t cert_load_error_code;

	if (rsPeers->loadDetailsFromStringCert(certificate.toUtf8().constData(), peerDetails, cert_load_error_code))
	{
#ifdef FRIEND_WIZARD_DEBUG
		std::cerr << "ConnectFriendWizard got id : " << peerDetails.id << "; gpg_id : " << peerDetails.gpg_id << std::endl;
#endif
        mCertificate = certificate.toUtf8().constData();

        // Cyril: I disabled this because it seems to be not used anymore.
        //setStartId(friendRequest ? Page_FriendRequest : Page_Conclusion);
        setStartId(Page_Conclusion);
        if (friendRequest){
        ui->fr_label->show();
        ui->requestinfolabel->show();
        setTitleText(ui->ConclusionPage, tr("Friend request"));
        ui->ConclusionPage->setSubTitle(tr("Details about the request"));
        }
    } else {
		// error message
		setField("errorMessage", tr("Certificate Load Failed") + ": \n\n" + getErrorString(cert_load_error_code)) ;
		setStartId(Page_ErrorMessage);
	}
}
Example #15
0
void LoginManager::onGetScoreInfoReply(QNetworkReply* reply, int code, const QJsonObject& score)
      {
      if (code == HTTP_OK) {
            if (score.value("user") != QJsonValue::Undefined) {
                  QJsonObject user = score.value("user").toObject();
                  QString title = score.value("title").toString();
                  QString description = score.value("description").toString();
                  QString sharing = score.value("sharing").toString();
                  QString license = score.value("license").toString();
                  QString tags = score.value("tags").toString();
                  QString url = score.value("custom_url").toString();
                  if (user.value("uid") != QJsonValue::Undefined) {
                        int uid = user.value("uid").toString().toInt();
                        if (uid == _uid)
                              emit getScoreSuccess(title, description, (sharing == "private"), license, tags, url);
                        else
                              emit getScoreError("");
                        }
                  else {
                       emit getScoreError("");
                       }
                  }
            else {
                  emit getScoreError("");
                  }
            }
      else
            emit getScoreError(getErrorString(reply, score));
      }
Example #16
0
void ClState::errorCheck(util::Str8 str, int32 err){
	if (err != CL_SUCCESS){
		util::Str8 msg= str + ": ";
		msg +=	getErrorString(err);
		release_ensure_msg(0, "%s", msg.cStr());
	}
}
Example #17
0
static
HANDLE
launchApp(HWND hwnd, bool testing, DWORD* threadID)
{
	// decide if client or server
	const bool isClient = isClientChecked(hwnd);
	const char* app = isClient ? CLIENT_APP : SERVER_APP;

	// prepare command line
	CString cmdLine = getCommandLine(hwnd, testing, false);
	if (cmdLine.empty()) {
		return NULL;
	}

	// start child
	PROCESS_INFORMATION procInfo;
	if (!execApp(app, cmdLine, &procInfo)) {
		showError(hwnd, CStringUtil::format(
								getString(IDS_STARTUP_FAILED).c_str(),
								getErrorString(GetLastError()).c_str()));
		return NULL;
	}

	// don't need process handle
	CloseHandle(procInfo.hProcess);

	// save thread ID if desired
	if (threadID != NULL) {
		*threadID = procInfo.dwThreadId;
	}

	// return thread handle
	return procInfo.hThread;
}
Example #18
0
void CLCommandQueue::enqueueWriteBufferBlocking(cl_mem buffer, size_t size, void* data) {
    int err = 0;
    err = clEnqueueWriteBuffer(*_commands, buffer, CL_TRUE, 0, size, data, 0, NULL, NULL);
    if (err != 0) {
        LFATAL("Could not write buffer: " << getErrorString(err));
    }
}
Example #19
0
void 
OMXMLReaderExpat::endNamespaceDeclHandler(const XML_Char* prefix)
{
    TRACE("OMXMLReaderExpat::endNamespaceDeclHandler");

    if (prefix != 0)
    {
        wchar_t* workBuffer = getWorkBuffer(xmlStringLen(prefix) + 1);
        readCharacters(workBuffer, prefix, 0);
        _endNmspaceDecls.append(workBuffer);
    }
    else
    {
        _endNmspaceDecls.append(L"");
    }
    
    XML_Status status = XML_StopParser(_parser, true);
    if (status != XML_STATUS_OK)
    {
        XML_Error errorCode = XML_GetErrorCode(_parser);
        if (errorCode != XML_ERROR_SUSPENDED)
        {
            throw OMException(getErrorString());
        }
    }

    registerEvent(END_PREFIX_MAPPING);
}
Example #20
0
void 
OMXMLReaderExpat::startNamespaceDeclHandler(const XML_Char* prefix, const XML_Char* uri)
{
    TRACE("OMXMLReaderExpat::startNamespaceDeclHandler");

    QName* qName = new QName;
    
    if (prefix != 0)
    {
        wchar_t* workBuffer = getWorkBuffer(xmlStringLen(prefix) + 1);
        readCharacters(workBuffer, prefix, 0);
        qName->prefix = workBuffer;
    }

    if (uri != 0)
    {
        wchar_t* workBuffer = getWorkBuffer(xmlStringLen(uri) + 1);
        readCharacters(workBuffer, uri, 0);
        qName->uri = workBuffer;
    }

    _startNmspaceDecls.append(qName);

    XML_Status status = XML_StopParser(_parser, true);
    if (status != XML_STATUS_OK)
    {
        XML_Error errorCode = XML_GetErrorCode(_parser);
        if (errorCode != XML_ERROR_SUSPENDED)
        {
            throw OMException(getErrorString());
        }
    }

    registerEvent(START_PREFIX_MAPPING);
}
Example #21
0
void CLCommandQueue::enqueueKernelBlocking(const CLKernel& kernel, const CLWorkSize& ws)  {
    int err = 0;
    err = clEnqueueNDRangeKernel(*_commands, kernel(), ws.dimensions(), NULL, ws.global(), ws.local(), 0, NULL, NULL);
    if (err != 0) {
        LFATAL("Could not run kernel: " << getErrorString(err));
    }
}
Example #22
0
void UnixFileWatcher::run()
{
    struct timeval  timeoutStruct;
    int             ret;
    long            timeout = DefaultTimeoutMs;
    fd_set          readSet;
    std::size_t     buflen = 1024 * (sizeof(struct inotify_event) + 16);
    char            buf[buflen];
    int             len;
    inotify_event*  event;

    while (_isRunning)
    {
        FD_ZERO(&readSet);
        FD_SET(_inotifyFd, &readSet);
        timeoutStruct.tv_sec = timeout / 1000;
        timeoutStruct.tv_usec = (timeout % 1000) * 1000;
        if ((ret = ::select(_inotifyFd + 1, &readSet, nullptr, nullptr, &timeoutStruct)) == -1)
        {
            if (errno != EINTR)
                throw (std::runtime_error(getErrorString("select", errno)));
            else
                throw (std::runtime_error(getErrorString("select", errno)));
        }
        else if (ret > 0)
        {
            if (!FD_ISSET(_inotifyFd, &readSet))
                throw (std::runtime_error("unexpected file descriptor set"));
            if ((len = read(_inotifyFd, buf, buflen)) == -1)
            {
                if (errno != EINTR)
                    throw (std::runtime_error(getErrorString("read", errno)));
            }
            else if (!len)
                throw (std::runtime_error("nothing was read"));
            else
            {
                for (int i = 0; i < len;)
                {
                    event = reinterpret_cast<inotify_event*>(&buf[i]); // NOTE Alignment should not be an issue here
                    _watches.at(event->wd).mask |= event->mask;
                    i += sizeof(inotify_event) + event->len;
                }
            }
        }
    }
}
Example #23
0
		void error_check(CUresult result, const char *msg)
		{
			if(result == CUDA_SUCCESS) return;
			std::string str;
			if(msg) str += std::string(msg) + ": ";
			str += getErrorString(result);
			throw ::cuda::Exception(str.c_str());
		}
Example #24
0
void ATPClientApp::lookupAsset() {
    auto path = _url.path();
    auto request = DependencyManager::get<AssetClient>()->createGetMappingRequest(path);
    QObject::connect(request, &GetMappingRequest::finished, this, [=](GetMappingRequest* request) mutable {
        auto result = request->getError();
        if (result == GetMappingRequest::NotFound) {
            qDebug() << "not found: " << request->getErrorString();
        } else if (result == GetMappingRequest::NoError) {
            qDebug() << "found, hash is " << request->getHash();
            download(request->getHash());
        } else {
            qDebug() << "error -- " << request->getError() << " -- " << request->getErrorString();
        }
        request->deleteLater();
    });
    request->start();
}
ULXR_API_IMPL0
  TcpIpConnection::TcpIpConnection(bool I_am_server, const CppString &dom, unsigned prt)
  : Connection()
  , pimpl(new PImpl)
{
  ULXR_TRACE(ULXR_PCHAR("TcpIpConnection(bool, string, uint)") << dom << ULXR_PCHAR(" ") << pimpl->port);
  init(prt);

  pimpl->remote_name = dom;

  struct hostent *hp = getHostAdress(dom);
  if (hp == 0)
    throw ConnectionException(SystemError,
                              ulxr_i18n(ULXR_PCHAR("Host adress not found: ")) + pimpl->serverdomain, 500);
  memcpy(&(pimpl->hostdata.sin_addr), hp->h_addr_list[0], hp->h_length);

  if (I_am_server)
  {
    pimpl->server_data = new ServerSocketData(socket(AF_INET, SOCK_STREAM, IPPROTO_TCP));
    if (getServerHandle() < 0)
      throw ConnectionException(SystemError,
                                ulxr_i18n(ULXR_PCHAR("Could not create socket: "))
                                     + ULXR_GET_STRING(getErrorString(getLastError())), 500);
#ifdef ULXR_REUSE_SOCKET
    int sockOpt = 1;
    if (::setsockopt(getServerHandle(), SOL_SOCKET, SO_REUSEADDR,
                     (const char*)&sockOpt, sizeof(sockOpt)) < 0)
      throw ConnectionException(SystemError,
                                ulxr_i18n(ULXR_PCHAR("Could not set reuse flag for socket: "))
                                     + ULXR_GET_STRING(getErrorString(getLastError())), 500);
#endif

    int iOptVal = getTimeout() * 1000;
    int iOptLen = sizeof(int);
    ::setsockopt(getServerHandle(), SOL_SOCKET, SO_RCVTIMEO, (char*)&iOptVal, iOptLen);
    ::setsockopt(getServerHandle(), SOL_SOCKET, SO_SNDTIMEO, (char*)&iOptVal, iOptLen);

    if((::bind(getServerHandle(), (sockaddr*) &pimpl->hostdata, sizeof(pimpl->hostdata))) < 0)
      throw ConnectionException(SystemError,
                                ulxr_i18n(ULXR_PCHAR("Could not bind adress: "))
                                     + ULXR_GET_STRING(getErrorString(getLastError())), 500);

    listen(getServerHandle(), 5);
  }
}
ULXR_API_IMPL(void) TcpIpConnection::open()
{
  ULXR_TRACE(ULXR_PCHAR("open"));
  if (isOpen() )
    throw RuntimeException(ApplicationError,
                           ulxr_i18n(ULXR_PCHAR("Attempt to open an already open connection")));

  if (pimpl->server_data != 0)
    throw ConnectionException(SystemError,
                              ulxr_i18n(ULXR_PCHAR("Connection is NOT prepared for client mode")), 500);
//  resetConnection();

  setHandle(socket(AF_INET, SOCK_STREAM, IPPROTO_TCP));
  if (getHandle() < 0)
    throw ConnectionException(SystemError,
                              ulxr_i18n(ULXR_PCHAR("Could not create socket: "))
                                   + ULXR_GET_STRING(getErrorString(getLastError())), 500);

  int iOptVal = getTimeout() * 1000;
  int iOptLen = sizeof(int);
  ::setsockopt(getHandle(), SOL_SOCKET, SO_RCVTIMEO, (char*)&iOptVal, iOptLen);
  ::setsockopt(getHandle(), SOL_SOCKET, SO_SNDTIMEO, (char*)&iOptVal, iOptLen);
  doTcpNoDelay();

  if(connect(getHandle(), (struct sockaddr *)&pimpl->hostdata, sizeof(pimpl->hostdata)) < 0)
    throw ConnectionException(SystemError,
                              ulxr_i18n(ULXR_PCHAR("Could not connect: "))
                                   + ULXR_GET_STRING(getErrorString(getLastError())), 500);

  ULXR_TRACE(ULXR_PCHAR("/open.peername"));
#ifdef ULXR_ENABLE_GET_PEERNAME
  pimpl->remotedata_len = sizeof(pimpl->remotedata);
  if(getpeername(getHandle(),
                 (struct sockaddr *)&pimpl->remotedata,
                 &pimpl->remotedata_len)<0)
    throw ConnectionException(SystemError,
                              ulxr_i18n(ULXR_PCHAR("Could not get peer data: "))
                                   + ULXR_GET_STRING(getErrorString(getLastError())), 500);
#ifdef __BORLANDC__
  pimpl->remote_name = ULXR_PCHAR("<remote-host>");  // FIXME, not working
  host = 0;
  host;
#else
  else
  {
Example #27
0
void Socket::init(const std::string& address, unsigned short port)
{
	close();

	if(initAddress(mAddr, address, port, true) == false){
		WT_THROW("%s", getErrorString().c_str());
	}

	mSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);

	if(mSocket == SOCKET_ERROR){
		WT_THROW("%s", getErrorString().c_str());
	}

	if( bind(mSocket, (SOCKADDR*)&mAddr, sizeof(SOCKADDR)) == SOCKET_ERROR ){
		WT_THROW("%s", getErrorString().c_str());
	}
}
        void init() 
        {
          InternalMessage("Sound","Sound::OpenAL::init entering") ;

          if (!system.get())
            system.reset(new SoundSystem()) ;

          InternalMessage("Sound","Sound::OpenAL::init leaving with status: " + getErrorString(alGetError())) ;
      }
void SkDisplayXMLParserError::setInnerError(SkAnimateMaker* parent, const SkString& src) {
    SkString inner;
    getErrorString(&inner);
    inner.prepend(": ");
    inner.prependS32(getLineNumber());
    inner.prepend(", line ");
    inner.prepend(src);
    parent->setErrorNoun(inner);
}
Example #30
0
/**
* Dump the contents of this device to the logger.
*
* @param   StringBuilder* The buffer into which this fxn should write its output.
*/
void LSM9DSx_Common::dumpDevRegs(StringBuilder *output) {
  output->concatf("\n-------------------------------------------------------\n--- IMU 0x%04x  %s ==>  %s \n-------------------------------------------------------\n", BUS_ADDR, getStateString(imu_state), (desired_state_attained() ? "STABLE" : getStateString(desired_state)));
  output->concatf("--- sample_count        %d\n--- pending_samples     %d\n\n", sample_count, *pending_samples);
  if (getVerbosity() > 1) {
    output->concatf("--- calibration smpls   %d\n", sb_next_write);
    output->concatf("--- Base filter param   %d\n", base_filter_param);
  }
  output->concatf("--- Error condition     %s\n---\n", getErrorString(error_condition));
}