public SbProcess AttachToProcessWithID(SbListener listener, ulong pid, out SbError error) { var request = new AttachToProcessWithIDRequest() { Target = grpcSbTarget, Listener = new GrpcSbListener() { Id = listener.GetId() }, Pid = pid, }; AttachToProcessWithIDResponse response = null; if (connection.InvokeRpc(() => { response = client.AttachToProcessWithID(request); })) { error = errorFactory.Create(response.Error); if (response.Process == null) { return(null); } return(processFactory.Create(connection, response.Process)); } var grpcError = new GrpcSbError { Success = false, Error = "Rpc error while calling AttachToProcessWithId." }; error = errorFactory.Create(grpcError); return(null); }
public EventType AddListener(SbListener listener, EventType eventMask) { var request = new AddListenerRequest { Target = grpcSbTarget, Listener = new GrpcSbListener { Id = listener.GetId() }, EventMask = (uint)eventMask }; AddListenerResponse response = null; if (connection.InvokeRpc(() => { response = client.AddListener(request); })) { return((EventType)response.Result); } return(0); }