void UpdateExtraAnnotationsJob::finalizeAsyncRun()
{
    if (context().isOutdated())
        return;

    context().client->annotations(AnnotationsMessage(m_pinnedFileContainer, asyncResult()));
}
void RequestDocumentAnnotationsJob::finalizeAsyncRun()
{
    if (context().isDocumentOpen()) {
        const AsyncResult result = asyncResult();
        sendAnnotations(result);
    }
}
void UpdateExtraDocumentAnnotationsJob::finalizeAsyncRun()
{
    if (context().isOutdated())
        return;

    context().client->documentAnnotationsChanged(
                DocumentAnnotationsChangedMessage(m_pinnedFileContainer, asyncResult()));
}
void ResumeDocumentJob::finalizeAsyncRun()
{
    if (context().isDocumentOpen()) {
        if (QTC_GUARD(asyncResult().updateResult.hasReparsed()))
            m_pinnedDocument.setIsSuspended(false);
    }

    UpdateAnnotationsJob::finalizeAsyncRun();
}
void UpdateDocumentAnnotationsJob::finalizeAsyncRun()
{
    if (!context().isOutdated()) {
        const AsyncResult result = asyncResult();

        incorporateUpdaterResult(result);
        sendAnnotations(result);
    }
}
void CompleteCodeJob::finalizeAsyncRun()
{
    if (context().isDocumentOpen()) {
        const AsyncResult result = asyncResult();

        const CodeCompletedMessage message(result.completions,
                                           result.correction,
                                           context().jobRequest.ticketNumber);
        context().client->codeCompleted(message);
    }
}
void UpdateAnnotationsJob::finalizeAsyncRun()
{
    if (!context().isOutdated()) {
        const AsyncResult result = asyncResult();

        m_pinnedDocument.incorporateUpdaterResult(result.updateResult);
        m_pinnedDocument.setUnresolvedFilePaths(result.unresolvedFilePaths);

        context().client->annotations(AnnotationsMessage(m_pinnedFileContainer,
                                                         result.diagnostics,
                                                         result.firstHeaderErrorDiagnostic,
                                                         result.tokenInfos,
                                                         result.skippedSourceRanges));
    }
}
Exemple #8
0
	AsyncResultPtr Socket::BeginDisconnect(bool reuseSocket, AsyncCallback callback, const ObjectPtr &asyncState)
	{
		AsyncResultPtr asyncResult(this, Nothing, asyncState, Nothing, callback);
		asyncResult->AddRef();

		DWORD dwFlags = reuseSocket ? TF_REUSE_SOCKET : 0;

		SocketProvider &msp = SocketProvider::GetSingleton();
		if (!msp.DisconnectEx(hSocket, asyncResult.operator ->(), dwFlags, 0)
			&& WSAGetLastError() != WSA_IO_PENDING)
		{
			asyncResult->Release();
			throw Win32Exception("DisconnectEx");
		}

		return asyncResult;
	}
Exemple #9
0
	AsyncResultPtr Socket::BeginAccept(AsyncCallback callback, const ObjectPtr &asyncState)
	{
		BufferPtr acceptBuffer((sizeof(sockaddr_in) + 16) * 2, NoRebindTag());
		SocketPtr acceptSocket;
		AsyncResultPtr asyncResult(this, acceptBuffer, asyncState, acceptSocket, callback);
		asyncResult->AddRef();

		SocketProvider &msp = SocketProvider::GetSingleton();
		if (!msp.AcceptEx(hSocket, acceptSocket->hSocket, acceptBuffer->Pointer(), 0,
			sizeof(sockaddr_in) + 16, sizeof(sockaddr_in) + 16, 0, asyncResult.operator ->())
			&& WSAGetLastError() != ERROR_IO_PENDING)
		{
			asyncResult->Release();
			throw Win32Exception("AcceptEx");
		}

		return asyncResult;
	}
Exemple #10
0
	AsyncResultPtr Socket::BeginSend(const BufferPtr &buffer, AsyncCallback callback, const ObjectPtr &asyncState)
	{
		AsyncResultPtr asyncResult(this, buffer, asyncState, Nothing, callback);
		asyncResult->AddRef();

		WSABUF wsabuf;
		wsabuf.buf = (char *)buffer->Pointer();
		wsabuf.len = buffer->Size();

		DWORD flags = 0;

		if (0 != WSASend(hSocket, &wsabuf, 1, 0, flags, asyncResult.operator ->(), 0)
			&& WSAGetLastError() != WSA_IO_PENDING)
		{
			asyncResult->Release();
			throw Win32Exception("WSASend");
		}

		return asyncResult;
	}
Exemple #11
0
	AsyncResultPtr Socket::BeginConnect(u_short port, IPAddress address, AsyncCallback callback, const ObjectPtr &asyncState)
	{
		AsyncResultPtr asyncResult(this, Nothing, asyncState, Nothing, callback);
		asyncResult->AddRef();

		sockaddr_in name;
		name.sin_family = AF_INET;
		name.sin_port = htons(port);
		name.sin_addr.s_addr = htonl(address.Address());

		SocketProvider &msp = SocketProvider::GetSingleton();
		if (!msp.ConnectEx(hSocket, (SOCKADDR *)&name, sizeof(SOCKADDR), 0, 0, 0, asyncResult.operator ->())
			&& WSAGetLastError() != WSA_IO_PENDING)
		{
			asyncResult->Release();
			throw Win32Exception("ConnectEx");
		}

		return asyncResult;
	}