diff --git a/src/csharp/GrpcApi/MathExamples.cs b/src/csharp/GrpcApi/MathExamples.cs index 2202c52a27776f5cc1f01bf80880c08cb79da942..97c91b1b1b586248b03e4d94200e7a9629627fef 100644 --- a/src/csharp/GrpcApi/MathExamples.cs +++ b/src/csharp/GrpcApi/MathExamples.cs @@ -32,10 +32,10 @@ #endregion using System; -using System.Threading.Tasks; using System.Collections.Generic; using System.Reactive.Linq; -using Google.GRPC.Core.Utils; +using System.Threading.Tasks; +using Grpc.Core.Utils; namespace math { diff --git a/src/csharp/GrpcApi/MathGrpc.cs b/src/csharp/GrpcApi/MathGrpc.cs index 44e704e4969d257c078d09cdc19aa99027f8ae9a..f938a245439b9bb04222c1c86ded99ab0b820d11 100644 --- a/src/csharp/GrpcApi/MathGrpc.cs +++ b/src/csharp/GrpcApi/MathGrpc.cs @@ -32,11 +32,11 @@ #endregion using System; -using System.Threading; -using System.Threading.Tasks; using System.Collections.Generic; using System.Reactive.Linq; -using Google.GRPC.Core; +using System.Threading; +using System.Threading.Tasks; +using Grpc.Core; namespace math { @@ -99,31 +99,31 @@ namespace math public DivReply Div(DivArgs request, CancellationToken token = default(CancellationToken)) { - var call = new Google.GRPC.Core.Call<DivArgs, DivReply>(divMethod, channel); + var call = new Grpc.Core.Call<DivArgs, DivReply>(divMethod, channel); return Calls.BlockingUnaryCall(call, request, token); } public Task<DivReply> DivAsync(DivArgs request, CancellationToken token = default(CancellationToken)) { - var call = new Google.GRPC.Core.Call<DivArgs, DivReply>(divMethod, channel); + var call = new Grpc.Core.Call<DivArgs, DivReply>(divMethod, channel); return Calls.AsyncUnaryCall(call, request, token); } public void Fib(FibArgs request, IObserver<Num> responseObserver, CancellationToken token = default(CancellationToken)) { - var call = new Google.GRPC.Core.Call<FibArgs, Num>(fibMethod, channel); + var call = new Grpc.Core.Call<FibArgs, Num>(fibMethod, channel); Calls.AsyncServerStreamingCall(call, request, responseObserver, token); } public ClientStreamingAsyncResult<Num, Num> Sum(CancellationToken token = default(CancellationToken)) { - var call = new Google.GRPC.Core.Call<Num, Num>(sumMethod, channel); + var call = new Grpc.Core.Call<Num, Num>(sumMethod, channel); return Calls.AsyncClientStreamingCall(call, token); } public IObserver<DivArgs> DivMany(IObserver<DivReply> responseObserver, CancellationToken token = default(CancellationToken)) { - var call = new Google.GRPC.Core.Call<DivArgs, DivReply>(divManyMethod, channel); + var call = new Grpc.Core.Call<DivArgs, DivReply>(divManyMethod, channel); return Calls.DuplexStreamingCall(call, responseObserver, token); } } diff --git a/src/csharp/GrpcApi/MathServiceImpl.cs b/src/csharp/GrpcApi/MathServiceImpl.cs index 1a2f98f8b265e3a78278b96a0b86187db5555cbf..462fab4454fdf6f25b75ab8ad976fea82687e91b 100644 --- a/src/csharp/GrpcApi/MathServiceImpl.cs +++ b/src/csharp/GrpcApi/MathServiceImpl.cs @@ -32,11 +32,11 @@ #endregion using System; -using System.Threading; -using System.Threading.Tasks; using System.Collections.Generic; using System.Reactive.Linq; -using Google.GRPC.Core.Utils; +using System.Threading; +using System.Threading.Tasks; +using Grpc.Core.Utils; namespace math { diff --git a/src/csharp/GrpcApi/TestServiceGrpc.cs b/src/csharp/GrpcApi/TestServiceGrpc.cs index 64d5c0956330b66f8c40822ee30d869ebaf4e525..15700e40ac58e3eee775b6ab14ba271a305d89a4 100644 --- a/src/csharp/GrpcApi/TestServiceGrpc.cs +++ b/src/csharp/GrpcApi/TestServiceGrpc.cs @@ -30,12 +30,13 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion + using System; -using System.Threading; -using System.Threading.Tasks; using System.Collections.Generic; using System.Reactive.Linq; -using Google.GRPC.Core; +using System.Threading; +using System.Threading.Tasks; +using Grpc.Core; namespace grpc.testing { @@ -119,49 +120,49 @@ namespace grpc.testing public Empty EmptyCall(Empty request, CancellationToken token = default(CancellationToken)) { - var call = new Google.GRPC.Core.Call<Empty, Empty>(emptyCallMethod, channel); + var call = new Grpc.Core.Call<Empty, Empty>(emptyCallMethod, channel); return Calls.BlockingUnaryCall(call, request, token); } public Task<Empty> EmptyCallAsync(Empty request, CancellationToken token = default(CancellationToken)) { - var call = new Google.GRPC.Core.Call<Empty, Empty>(emptyCallMethod, channel); + var call = new Grpc.Core.Call<Empty, Empty>(emptyCallMethod, channel); return Calls.AsyncUnaryCall(call, request, token); } public SimpleResponse UnaryCall(SimpleRequest request, CancellationToken token = default(CancellationToken)) { - var call = new Google.GRPC.Core.Call<SimpleRequest, SimpleResponse>(unaryCallMethod, channel); + var call = new Grpc.Core.Call<SimpleRequest, SimpleResponse>(unaryCallMethod, channel); return Calls.BlockingUnaryCall(call, request, token); } public Task<SimpleResponse> UnaryCallAsync(SimpleRequest request, CancellationToken token = default(CancellationToken)) { - var call = new Google.GRPC.Core.Call<SimpleRequest, SimpleResponse>(unaryCallMethod, channel); + var call = new Grpc.Core.Call<SimpleRequest, SimpleResponse>(unaryCallMethod, channel); return Calls.AsyncUnaryCall(call, request, token); } public void StreamingOutputCall(StreamingOutputCallRequest request, IObserver<StreamingOutputCallResponse> responseObserver, CancellationToken token = default(CancellationToken)) { - var call = new Google.GRPC.Core.Call<StreamingOutputCallRequest, StreamingOutputCallResponse>(streamingOutputCallMethod, channel); + var call = new Grpc.Core.Call<StreamingOutputCallRequest, StreamingOutputCallResponse>(streamingOutputCallMethod, channel); Calls.AsyncServerStreamingCall(call, request, responseObserver, token); } public ClientStreamingAsyncResult<StreamingInputCallRequest, StreamingInputCallResponse> StreamingInputCall(CancellationToken token = default(CancellationToken)) { - var call = new Google.GRPC.Core.Call<StreamingInputCallRequest, StreamingInputCallResponse>(streamingInputCallMethod, channel); + var call = new Grpc.Core.Call<StreamingInputCallRequest, StreamingInputCallResponse>(streamingInputCallMethod, channel); return Calls.AsyncClientStreamingCall(call, token); } public IObserver<StreamingOutputCallRequest> FullDuplexCall(IObserver<StreamingOutputCallResponse> responseObserver, CancellationToken token = default(CancellationToken)) { - var call = new Google.GRPC.Core.Call<StreamingOutputCallRequest, StreamingOutputCallResponse>(fullDuplexCallMethod, channel); + var call = new Grpc.Core.Call<StreamingOutputCallRequest, StreamingOutputCallResponse>(fullDuplexCallMethod, channel); return Calls.DuplexStreamingCall(call, responseObserver, token); } public IObserver<StreamingOutputCallRequest> HalfDuplexCall(IObserver<StreamingOutputCallResponse> responseObserver, CancellationToken token = default(CancellationToken)) { - var call = new Google.GRPC.Core.Call<StreamingOutputCallRequest, StreamingOutputCallResponse>(halfDuplexCallMethod, channel); + var call = new Grpc.Core.Call<StreamingOutputCallRequest, StreamingOutputCallResponse>(halfDuplexCallMethod, channel); return Calls.DuplexStreamingCall(call, responseObserver, token); } } diff --git a/src/csharp/GrpcApiTests/MathClientServerTests.cs b/src/csharp/GrpcApiTests/MathClientServerTests.cs index 9056142097b7614e8203421f007508d6ec3542db..767340d6f2b287a8af169eb07e6c7ce0c7c0aa50 100644 --- a/src/csharp/GrpcApiTests/MathClientServerTests.cs +++ b/src/csharp/GrpcApiTests/MathClientServerTests.cs @@ -32,12 +32,12 @@ #endregion using System; -using NUnit.Framework; -using Google.GRPC.Core; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; -using Google.GRPC.Core.Utils; -using System.Collections.Generic; +using Grpc.Core; +using Grpc.Core.Utils; +using NUnit.Framework; namespace math.Tests { diff --git a/src/csharp/GrpcCore/Call.cs b/src/csharp/GrpcCore/Call.cs index 93a7507b2fae533630587cb29f70f6c7c941b24d..72dca688952ccd78fd87ae329c3c5dbc43808bda 100644 --- a/src/csharp/GrpcCore/Call.cs +++ b/src/csharp/GrpcCore/Call.cs @@ -32,9 +32,9 @@ #endregion using System; -using Google.GRPC.Core.Internal; +using Grpc.Core.Internal; -namespace Google.GRPC.Core +namespace Grpc.Core { public class Call<TRequest, TResponse> { diff --git a/src/csharp/GrpcCore/Calls.cs b/src/csharp/GrpcCore/Calls.cs index e5ddd879d6834c71eafce2086d476768185cd56d..b67332676aca75ecb0c7c8b8738e5320f851155b 100644 --- a/src/csharp/GrpcCore/Calls.cs +++ b/src/csharp/GrpcCore/Calls.cs @@ -34,9 +34,9 @@ using System; using System.Threading; using System.Threading.Tasks; -using Google.GRPC.Core.Internal; +using Grpc.Core.Internal; -namespace Google.GRPC.Core +namespace Grpc.Core { // NOTE: this class is work-in-progress diff --git a/src/csharp/GrpcCore/Channel.cs b/src/csharp/GrpcCore/Channel.cs index d1f795541cc1f3113e8a5bdf70a6f61d49250f5d..942651cf3935a3cf3a567573e5c87aa5c35fd64a 100644 --- a/src/csharp/GrpcCore/Channel.cs +++ b/src/csharp/GrpcCore/Channel.cs @@ -35,9 +35,9 @@ using System; using System.Runtime.InteropServices; using System.Threading; using System.Threading.Tasks; -using Google.GRPC.Core.Internal; +using Grpc.Core.Internal; -namespace Google.GRPC.Core +namespace Grpc.Core { public class Channel : IDisposable { diff --git a/src/csharp/GrpcCore/ClientStreamingAsyncResult.cs b/src/csharp/GrpcCore/ClientStreamingAsyncResult.cs index f82fe5f26ced5568b0fec976662394a7b879da4b..44580a115424110c78adc13ca11618b54320727c 100644 --- a/src/csharp/GrpcCore/ClientStreamingAsyncResult.cs +++ b/src/csharp/GrpcCore/ClientStreamingAsyncResult.cs @@ -34,7 +34,7 @@ using System; using System.Threading.Tasks; -namespace Google.GRPC.Core +namespace Grpc.Core { /// <summary> /// Return type for client streaming async method. diff --git a/src/csharp/GrpcCore/GrpcEnvironment.cs b/src/csharp/GrpcCore/GrpcEnvironment.cs index 55a6cac8f69785a5353e22e682acc0b52e2b1823..0e3a0a581cd8a71717bcfa318f429d64e4c65a0c 100644 --- a/src/csharp/GrpcCore/GrpcEnvironment.cs +++ b/src/csharp/GrpcCore/GrpcEnvironment.cs @@ -32,10 +32,10 @@ #endregion using System; -using Google.GRPC.Core.Internal; using System.Runtime.InteropServices; +using Grpc.Core.Internal; -namespace Google.GRPC.Core +namespace Grpc.Core { /// <summary> /// Encapsulates initialization and shutdown of gRPC library. diff --git a/src/csharp/GrpcCore/Internal/AsyncCall.cs b/src/csharp/GrpcCore/Internal/AsyncCall.cs index ce0ba30d53d607ec143d60c74862da0a3aa189c4..5e96092e27030c0964a6977797dcbd71eeddd466 100644 --- a/src/csharp/GrpcCore/Internal/AsyncCall.cs +++ b/src/csharp/GrpcCore/Internal/AsyncCall.cs @@ -32,14 +32,14 @@ #endregion using System; -using System.Runtime.InteropServices; using System.Diagnostics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; using System.Threading; using System.Threading.Tasks; -using System.Runtime.CompilerServices; -using Google.GRPC.Core.Internal; +using Grpc.Core.Internal; -namespace Google.GRPC.Core.Internal +namespace Grpc.Core.Internal { /// <summary> /// Handles native call lifecycle and provides convenience methods. @@ -381,7 +381,7 @@ namespace Google.GRPC.Core.Internal private void CompleteStreamObserver(Status status) { - if (status.StatusCode != StatusCode.GRPC_STATUS_OK) + if (status.StatusCode != StatusCode.OK) { // TODO: wrap to handle exceptions; readObserver.OnError(new RpcException(status)); @@ -413,13 +413,13 @@ namespace Google.GRPC.Core.Internal if (error != GRPCOpError.GRPC_OP_OK) { tcs.SetException(new RpcException( - new Status(StatusCode.GRPC_STATUS_INTERNAL, "Internal error occured.") + new Status(StatusCode.Internal, "Internal error occured.") )); return; } var status = ctx.GetReceivedStatus(); - if (status.StatusCode != StatusCode.GRPC_STATUS_OK) + if (status.StatusCode != StatusCode.OK) { tcs.SetException(new RpcException(status)); return; diff --git a/src/csharp/GrpcCore/Internal/BatchContextSafeHandleNotOwned.cs b/src/csharp/GrpcCore/Internal/BatchContextSafeHandleNotOwned.cs index ddfd94a3b5654ff612d2a757520fd69efd730045..75cd30e1a2d5f463c1d0e3f4d47091815e142db5 100644 --- a/src/csharp/GrpcCore/Internal/BatchContextSafeHandleNotOwned.cs +++ b/src/csharp/GrpcCore/Internal/BatchContextSafeHandleNotOwned.cs @@ -33,9 +33,9 @@ using System; using System.Runtime.InteropServices; -using Google.GRPC.Core; +using Grpc.Core; -namespace Google.GRPC.Core.Internal +namespace Grpc.Core.Internal { /// <summary> /// Not owned version of diff --git a/src/csharp/GrpcCore/Internal/CallSafeHandle.cs b/src/csharp/GrpcCore/Internal/CallSafeHandle.cs index 55d66a62ca74dcc38cb8108130bd19dee6853a9c..659a383b4bd71cef6005fd27ea6500232b340b15 100644 --- a/src/csharp/GrpcCore/Internal/CallSafeHandle.cs +++ b/src/csharp/GrpcCore/Internal/CallSafeHandle.cs @@ -32,11 +32,11 @@ #endregion using System; -using System.Runtime.InteropServices; using System.Diagnostics; -using Google.GRPC.Core; +using System.Runtime.InteropServices; +using Grpc.Core; -namespace Google.GRPC.Core.Internal +namespace Grpc.Core.Internal { //TODO: rename the delegate internal delegate void CompletionCallbackDelegate(GRPCOpError error, IntPtr batchContextPtr); diff --git a/src/csharp/GrpcCore/Internal/ChannelSafeHandle.cs b/src/csharp/GrpcCore/Internal/ChannelSafeHandle.cs index 379c83d5375961e5526fa9471779b20f51e2c008..f15ead35724d94ee4bc6b11b71543d7afa46bf5a 100644 --- a/src/csharp/GrpcCore/Internal/ChannelSafeHandle.cs +++ b/src/csharp/GrpcCore/Internal/ChannelSafeHandle.cs @@ -36,7 +36,7 @@ using System.Runtime.InteropServices; using System.Threading; using System.Threading.Tasks; -namespace Google.GRPC.Core.Internal +namespace Grpc.Core.Internal { /// <summary> /// grpc_channel from <grpc/grpc.h> diff --git a/src/csharp/GrpcCore/Internal/ClientStreamingInputObserver.cs b/src/csharp/GrpcCore/Internal/ClientStreamingInputObserver.cs index 4d10a9bdf965c03f38316cb30fc1937395ec872d..fb59e86e2d7f8e0d017abc4b26910ac8cc2fcb65 100644 --- a/src/csharp/GrpcCore/Internal/ClientStreamingInputObserver.cs +++ b/src/csharp/GrpcCore/Internal/ClientStreamingInputObserver.cs @@ -32,9 +32,9 @@ #endregion using System; -using Google.GRPC.Core.Internal; +using Grpc.Core.Internal; -namespace Google.GRPC.Core.Internal +namespace Grpc.Core.Internal { internal class ClientStreamingInputObserver<TWrite, TRead> : IObserver<TWrite> { diff --git a/src/csharp/GrpcCore/Internal/CompletionQueueSafeHandle.cs b/src/csharp/GrpcCore/Internal/CompletionQueueSafeHandle.cs index 5ea436df1977a44fc8b2f4ccfdbe94da614e720a..3f01fdbfd05c70d4ac130681d6af1ab91a6530c7 100644 --- a/src/csharp/GrpcCore/Internal/CompletionQueueSafeHandle.cs +++ b/src/csharp/GrpcCore/Internal/CompletionQueueSafeHandle.cs @@ -35,7 +35,7 @@ using System; using System.Runtime.InteropServices; using System.Threading.Tasks; -namespace Google.GRPC.Core.Internal +namespace Grpc.Core.Internal { /// <summary> /// grpc_completion_queue from <grpc/grpc.h> diff --git a/src/csharp/GrpcCore/Internal/Enums.cs b/src/csharp/GrpcCore/Internal/Enums.cs index d38896ec84332a0f6e0890d85231368f8bc14199..f363050b07e592583d0e34e681e367c54c4feb25 100644 --- a/src/csharp/GrpcCore/Internal/Enums.cs +++ b/src/csharp/GrpcCore/Internal/Enums.cs @@ -34,7 +34,7 @@ using System; using System.Runtime.InteropServices; -namespace Google.GRPC.Core.Internal +namespace Grpc.Core.Internal { /// <summary> /// from grpc/grpc.h diff --git a/src/csharp/GrpcCore/Internal/GrpcThreadPool.cs b/src/csharp/GrpcCore/Internal/GrpcThreadPool.cs index 634a0b2d721a0ea8490ff64d5ff84c45d62bd399..9e69fe2f43090a51c4ef1f1b430f2c56050cd27e 100644 --- a/src/csharp/GrpcCore/Internal/GrpcThreadPool.cs +++ b/src/csharp/GrpcCore/Internal/GrpcThreadPool.cs @@ -32,13 +32,13 @@ #endregion using System; -using Google.GRPC.Core.Internal; +using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading; using System.Threading.Tasks; -using System.Collections.Generic; +using Grpc.Core.Internal; -namespace Google.GRPC.Core.Internal +namespace Grpc.Core.Internal { /// <summary> /// Pool of threads polling on the same completion queue. diff --git a/src/csharp/GrpcCore/Internal/SafeHandleZeroIsInvalid.cs b/src/csharp/GrpcCore/Internal/SafeHandleZeroIsInvalid.cs index 59f08d4ca89741596346958128d58c1536cef841..aa6fce2e969ec4dc097fc07d0e6dc5c5491a9e4d 100644 --- a/src/csharp/GrpcCore/Internal/SafeHandleZeroIsInvalid.cs +++ b/src/csharp/GrpcCore/Internal/SafeHandleZeroIsInvalid.cs @@ -34,7 +34,7 @@ using System; using System.Runtime.InteropServices; -namespace Google.GRPC.Core.Internal +namespace Grpc.Core.Internal { /// <summary> /// Safe handle to wrap native objects. diff --git a/src/csharp/GrpcCore/Internal/ServerSafeHandle.cs b/src/csharp/GrpcCore/Internal/ServerSafeHandle.cs index 047bde1addfa310534bb3dabe65163837aaa8a29..de9bbaf7c123587e495f6bcfc17c2238ec41c75b 100644 --- a/src/csharp/GrpcCore/Internal/ServerSafeHandle.cs +++ b/src/csharp/GrpcCore/Internal/ServerSafeHandle.cs @@ -32,11 +32,11 @@ #endregion using System; -using System.Runtime.InteropServices; -using System.Diagnostics; using System.Collections.Concurrent; +using System.Diagnostics; +using System.Runtime.InteropServices; -namespace Google.GRPC.Core.Internal +namespace Grpc.Core.Internal { // TODO: we need to make sure that the delegates are not collected before invoked. internal delegate void ServerShutdownCallbackDelegate(IntPtr eventPtr); diff --git a/src/csharp/GrpcCore/Internal/ServerStreamingOutputObserver.cs b/src/csharp/GrpcCore/Internal/ServerStreamingOutputObserver.cs index e9cb65cb3b0bd6a55b74f1c5fcb862ca8d81362b..08d99214754bd9316a75f5a252fc0861694bbe7a 100644 --- a/src/csharp/GrpcCore/Internal/ServerStreamingOutputObserver.cs +++ b/src/csharp/GrpcCore/Internal/ServerStreamingOutputObserver.cs @@ -32,9 +32,9 @@ #endregion using System; -using Google.GRPC.Core.Internal; +using Grpc.Core.Internal; -namespace Google.GRPC.Core.Internal +namespace Grpc.Core.Internal { /// <summary> /// Observer that writes all arriving messages to a call abstraction (in blocking fashion) @@ -52,7 +52,7 @@ namespace Google.GRPC.Core.Internal public void OnCompleted() { // TODO: how bad is the Wait here? - call.SendStatusFromServerAsync(new Status(StatusCode.GRPC_STATUS_OK, "")).Wait(); + call.SendStatusFromServerAsync(new Status(StatusCode.OK, "")).Wait(); } public void OnError(Exception error) diff --git a/src/csharp/GrpcCore/Internal/Timespec.cs b/src/csharp/GrpcCore/Internal/Timespec.cs index 38b75180dc5f8cc4024a164918e653c82ae66dac..b191ecde94cc6e3e96cf966de8fe6813ab5b2628 100644 --- a/src/csharp/GrpcCore/Internal/Timespec.cs +++ b/src/csharp/GrpcCore/Internal/Timespec.cs @@ -35,7 +35,7 @@ using System; using System.Runtime.InteropServices; using System.Threading; -namespace Google.GRPC.Core.Internal +namespace Grpc.Core.Internal { /// <summary> /// gpr_timespec from grpc/support/time.h diff --git a/src/csharp/GrpcCore/Marshaller.cs b/src/csharp/GrpcCore/Marshaller.cs index f031354fd2d7f6043da510d4304924913e2a5078..602e0eb8240f4e3e7b258d3f1e370fe35ee437bc 100644 --- a/src/csharp/GrpcCore/Marshaller.cs +++ b/src/csharp/GrpcCore/Marshaller.cs @@ -33,7 +33,7 @@ using System; -namespace Google.GRPC.Core +namespace Grpc.Core { /// <summary> /// For serializing and deserializing messages. diff --git a/src/csharp/GrpcCore/Method.cs b/src/csharp/GrpcCore/Method.cs index 64a4f71396daca46547fa89dbbac51c3c5933971..c94aa8161fe7fb7aa2deb488ce003c88ce937d1c 100644 --- a/src/csharp/GrpcCore/Method.cs +++ b/src/csharp/GrpcCore/Method.cs @@ -33,7 +33,7 @@ using System; -namespace Google.GRPC.Core +namespace Grpc.Core { public enum MethodType { diff --git a/src/csharp/GrpcCore/RpcException.cs b/src/csharp/GrpcCore/RpcException.cs index 9ec1d2f2f330797031120b21682bc51568a4d523..5a9d0039bc9129c781e207d301f857d780574675 100644 --- a/src/csharp/GrpcCore/RpcException.cs +++ b/src/csharp/GrpcCore/RpcException.cs @@ -33,7 +33,7 @@ using System; -namespace Google.GRPC.Core +namespace Grpc.Core { public class RpcException : Exception { diff --git a/src/csharp/GrpcCore/Server.cs b/src/csharp/GrpcCore/Server.cs index 91842d81821cedcea89ebd6b533f34f1100f15fb..002592a3d888e9630f58a3fa7730ef7b130f7897 100644 --- a/src/csharp/GrpcCore/Server.cs +++ b/src/csharp/GrpcCore/Server.cs @@ -32,14 +32,14 @@ #endregion using System; -using System.Runtime.InteropServices; -using System.Diagnostics; -using System.Threading.Tasks; using System.Collections.Concurrent; using System.Collections.Generic; -using Google.GRPC.Core.Internal; +using System.Diagnostics; +using System.Runtime.InteropServices; +using System.Threading.Tasks; +using Grpc.Core.Internal; -namespace Google.GRPC.Core +namespace Grpc.Core { /// <summary> /// Server is implemented only to be able to do diff --git a/src/csharp/GrpcCore/ServerCallHandler.cs b/src/csharp/GrpcCore/ServerCallHandler.cs index 48d1eaa3359414aa482e4124a18f3974ea711cab..1296947f34d56569039593d2bc3d7a2aeb61652c 100644 --- a/src/csharp/GrpcCore/ServerCallHandler.cs +++ b/src/csharp/GrpcCore/ServerCallHandler.cs @@ -32,9 +32,9 @@ #endregion using System; -using Google.GRPC.Core.Internal; +using Grpc.Core.Internal; -namespace Google.GRPC.Core +namespace Grpc.Core { internal interface IServerCallHandler { @@ -111,7 +111,7 @@ namespace Google.GRPC.Core var finishedTask = asyncCall.ServerSideStreamingRequestCallAsync(new NullObserver<byte[]>()); - asyncCall.SendStatusFromServerAsync(new Status(StatusCode.GRPC_STATUS_UNIMPLEMENTED, "No such method.")).Wait(); + asyncCall.SendStatusFromServerAsync(new Status(StatusCode.Unimplemented, "No such method.")).Wait(); finishedTask.Wait(); } diff --git a/src/csharp/GrpcCore/ServerCalls.cs b/src/csharp/GrpcCore/ServerCalls.cs index 273029cab6099fdcabec60aca39cef54dcfe33bd..bed77796de10e7bedc3962326660d0eabd45afcf 100644 --- a/src/csharp/GrpcCore/ServerCalls.cs +++ b/src/csharp/GrpcCore/ServerCalls.cs @@ -33,7 +33,7 @@ using System; -namespace Google.GRPC.Core +namespace Grpc.Core { // TODO: perhaps add also serverSideStreaming and clientSideStreaming diff --git a/src/csharp/GrpcCore/ServerServiceDefinition.cs b/src/csharp/GrpcCore/ServerServiceDefinition.cs index 1eb17837e44817acc8c63a95875060dcac49112f..231c37606205fca9aa2fa700c40422bb90bd0dc4 100644 --- a/src/csharp/GrpcCore/ServerServiceDefinition.cs +++ b/src/csharp/GrpcCore/ServerServiceDefinition.cs @@ -34,7 +34,7 @@ using System; using System.Collections.Generic; -namespace Google.GRPC.Core +namespace Grpc.Core { public class ServerServiceDefinition { diff --git a/src/csharp/GrpcCore/Status.cs b/src/csharp/GrpcCore/Status.cs index 6430e6b7ab7d4e802233438adf0e4136cc90e15a..5ea1df7b481c2bec149fb0550f04b152a427b336 100644 --- a/src/csharp/GrpcCore/Status.cs +++ b/src/csharp/GrpcCore/Status.cs @@ -34,7 +34,7 @@ using System; using System.Runtime.InteropServices; -namespace Google.GRPC.Core +namespace Grpc.Core { /// <summary> /// Represents RPC result. diff --git a/src/csharp/GrpcCore/StatusCode.cs b/src/csharp/GrpcCore/StatusCode.cs index ba99f9b5e0b452c69f95fb1a448e0893e96955a0..1fbf9c1b68762a8068496fae9c9d78c897d74acb 100644 --- a/src/csharp/GrpcCore/StatusCode.cs +++ b/src/csharp/GrpcCore/StatusCode.cs @@ -33,22 +33,22 @@ using System; -namespace Google.GRPC.Core +namespace Grpc.Core { // TODO: element names should changed to comply with C# naming conventions. /// <summary> - /// grpc_status_code from grpc/status.h + /// based on grpc_status_code from grpc/status.h /// </summary> public enum StatusCode { /* Not an error; returned on success HTTP Mapping: 200 OK */ - GRPC_STATUS_OK = 0, + OK = 0, /* The operation was cancelled (typically by the caller). HTTP Mapping: 499 Client Closed Request */ - GRPC_STATUS_CANCELLED = 1, + Cancelled = 1, /* Unknown error. An example of where this error may be returned is if a Status value received from another address space belongs to an error-space that is not known in this address space. Also @@ -56,14 +56,14 @@ namespace Google.GRPC.Core may be converted to this error. HTTP Mapping: 500 Internal Server Error */ - GRPC_STATUS_UNKNOWN = 2, + Unknown = 2, /* Client specified an invalid argument. Note that this differs from FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments that are problematic regardless of the state of the system (e.g., a malformed file name). HTTP Mapping: 400 Bad Request */ - GRPC_STATUS_INVALID_ARGUMENT = 3, + InvalidArgument = 3, /* Deadline expired before operation could complete. For operations that change the state of the system, this error may be returned even if the operation has completed successfully. For example, a @@ -71,16 +71,16 @@ namespace Google.GRPC.Core enough for the deadline to expire. HTTP Mapping: 504 Gateway Timeout */ - GRPC_STATUS_DEADLINE_EXCEEDED = 4, + DeadlineExceeded = 4, /* Some requested entity (e.g., file or directory) was not found. HTTP Mapping: 404 Not Found */ - GRPC_STATUS_NOT_FOUND = 5, + NotFound = 5, /* Some entity that we attempted to create (e.g., file or directory) already exists. HTTP Mapping: 409 Conflict */ - GRPC_STATUS_ALREADY_EXISTS = 6, + AlreadyExists = 6, /* The caller does not have permission to execute the specified operation. PERMISSION_DENIED must not be used for rejections caused by exhausting some resource (use RESOURCE_EXHAUSTED @@ -89,17 +89,17 @@ namespace Google.GRPC.Core instead for those errors). HTTP Mapping: 403 Forbidden */ - GRPC_STATUS_PERMISSION_DENIED = 7, + PermissionDenied = 7, /* The request does not have valid authentication credentials for the operation. HTTP Mapping: 401 Unauthorized */ - GRPC_STATUS_UNAUTHENTICATED = 16, + Unauthenticated = 16, /* Some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system is out of space. HTTP Mapping: 429 Too Many Requests */ - GRPC_STATUS_RESOURCE_EXHAUSTED = 8, + ResourceExhausted = 8, /* Operation was rejected because the system is not in a state required for the operation's execution. For example, directory to be deleted may be non-empty, an rmdir operation is applied to @@ -126,7 +126,7 @@ namespace Google.GRPC.Core the request contains Etag related headers. So if the server does see Etag related headers in the request, it may choose to return 412 instead of 400 for this error code. */ - GRPC_STATUS_FAILED_PRECONDITION = 9, + FailedPrecondition = 9, /* The operation was aborted, typically due to a concurrency issue like sequencer check failures, transaction aborts, etc. @@ -134,7 +134,7 @@ namespace Google.GRPC.Core ABORTED, and UNAVAILABLE. HTTP Mapping: 409 Conflict */ - GRPC_STATUS_ABORTED = 10, + Aborted = 10, /* Operation was attempted past the valid range. E.g., seeking or reading past end of file. @@ -152,17 +152,17 @@ namespace Google.GRPC.Core they are done. HTTP Mapping: 400 Bad Request */ - GRPC_STATUS_OUT_OF_RANGE = 11, + OutOfRange = 11, /* Operation is not implemented or not supported/enabled in this service. HTTP Mapping: 501 Not Implemented */ - GRPC_STATUS_UNIMPLEMENTED = 12, + Unimplemented = 12, /* Internal errors. Means some invariants expected by underlying system has been broken. If you see one of these errors, something is very broken. HTTP Mapping: 500 Internal Server Error */ - GRPC_STATUS_INTERNAL = 13, + Internal = 13, /* The service is currently unavailable. This is a most likely a transient condition and may be corrected by retrying with a backoff. @@ -171,13 +171,11 @@ namespace Google.GRPC.Core ABORTED, and UNAVAILABLE. HTTP Mapping: 503 Service Unavailable */ - GRPC_STATUS_UNAVAILABLE = 14, + Unavailable = 14, /* Unrecoverable data loss or corruption. HTTP Mapping: 500 Internal Server Error */ - GRPC_STATUS_DATA_LOSS = 15, - /* Force users to include a default branch: */ - GRPC_STATUS__DO_NOT_USE = -1 + DataLoss = 15 } } diff --git a/src/csharp/GrpcCore/Utils/RecordingObserver.cs b/src/csharp/GrpcCore/Utils/RecordingObserver.cs index 0c784e1d3568fce61f08a1a2dc52c46172cb8a37..99d2725b70eda679b4c0679eb5d40365c67279a2 100644 --- a/src/csharp/GrpcCore/Utils/RecordingObserver.cs +++ b/src/csharp/GrpcCore/Utils/RecordingObserver.cs @@ -32,10 +32,10 @@ #endregion using System; -using System.Threading.Tasks; using System.Collections.Generic; +using System.Threading.Tasks; -namespace Google.GRPC.Core.Utils +namespace Grpc.Core.Utils { public class RecordingObserver<T> : IObserver<T> { diff --git a/src/csharp/GrpcCore/Utils/RecordingQueue.cs b/src/csharp/GrpcCore/Utils/RecordingQueue.cs index f8940d7584c02530c8c6077c93edd5e3cf0a0781..63992da6a95d8aa24ca72f5cf951ef7a87fe90ee 100644 --- a/src/csharp/GrpcCore/Utils/RecordingQueue.cs +++ b/src/csharp/GrpcCore/Utils/RecordingQueue.cs @@ -36,7 +36,7 @@ using System.Threading.Tasks; using System.Collections.Generic; using System.Collections.Concurrent; -namespace Google.GRPC.Core.Utils +namespace Grpc.Core.Utils { // TODO: replace this by something that implements IAsyncEnumerator. /// <summary> diff --git a/src/csharp/GrpcCoreTests/ClientServerTest.cs b/src/csharp/GrpcCoreTests/ClientServerTest.cs index ba43e4f6a07a904399a9799808b3662e609ffcfd..7e564a2fba59b190f54be1970ae785187ac2c1fd 100644 --- a/src/csharp/GrpcCoreTests/ClientServerTest.cs +++ b/src/csharp/GrpcCoreTests/ClientServerTest.cs @@ -32,15 +32,15 @@ #endregion using System; -using NUnit.Framework; -using Google.GRPC.Core; -using Google.GRPC.Core.Internal; -using System.Threading; using System.Diagnostics; +using System.Threading; using System.Threading.Tasks; -using Google.GRPC.Core.Utils; +using Grpc.Core; +using Grpc.Core.Internal; +using Grpc.Core.Utils; +using NUnit.Framework; -namespace Google.GRPC.Core.Tests +namespace Grpc.Core.Tests { public class ClientServerTest { @@ -133,7 +133,7 @@ namespace Google.GRPC.Core.Tests Calls.BlockingUnaryCall(call, "ABC", default(CancellationToken)); Assert.Fail(); } catch(RpcException e) { - Assert.AreEqual(StatusCode.GRPC_STATUS_UNIMPLEMENTED, e.Status.StatusCode); + Assert.AreEqual(StatusCode.Unimplemented, e.Status.StatusCode); } } diff --git a/src/csharp/GrpcCoreTests/GrpcEnvironmentTest.cs b/src/csharp/GrpcCoreTests/GrpcEnvironmentTest.cs index 8656b1bf01608e9c1cf8c2c3f074c86b28c9ecd5..8d3aef946a6358cb3cce15eddd8d11094debc2d3 100644 --- a/src/csharp/GrpcCoreTests/GrpcEnvironmentTest.cs +++ b/src/csharp/GrpcCoreTests/GrpcEnvironmentTest.cs @@ -32,11 +32,11 @@ #endregion using System; -using NUnit.Framework; -using Google.GRPC.Core; using System.Threading; +using Grpc.Core; +using NUnit.Framework; -namespace Google.GRPC.Core.Tests +namespace Grpc.Core.Tests { public class GrpcEnvironmentTest { diff --git a/src/csharp/GrpcCoreTests/ServerTest.cs b/src/csharp/GrpcCoreTests/ServerTest.cs index 43414a4cc49539f1a73c6638a3d323e39c1234f0..dd30366f6a1286684783b72848121238739f8d45 100644 --- a/src/csharp/GrpcCoreTests/ServerTest.cs +++ b/src/csharp/GrpcCoreTests/ServerTest.cs @@ -32,12 +32,12 @@ #endregion using System; +using Grpc.Core; +using Grpc.Core.Internal; +using Grpc.Core.Utils; using NUnit.Framework; -using Google.GRPC.Core.Internal; -using Google.GRPC.Core; -using Google.GRPC.Core.Utils; -namespace Google.GRPC.Core.Tests +namespace Grpc.Core.Tests { public class ServerTest { @@ -47,7 +47,7 @@ namespace Google.GRPC.Core.Tests GrpcEnvironment.Initialize(); Server server = new Server(); - int port = server.AddPort("localhost:0"); + server.AddPort("localhost:0"); server.Start(); server.ShutdownAsync().Wait(); diff --git a/src/csharp/GrpcCoreTests/TestResult.xml b/src/csharp/GrpcCoreTests/TestResult.xml index a5a6abd7b958c05ca4d263d7053fbc62fd18cc66..13da80739ceead3bd6e8477089ed94a9165d0a9b 100644 --- a/src/csharp/GrpcCoreTests/TestResult.xml +++ b/src/csharp/GrpcCoreTests/TestResult.xml @@ -15,17 +15,17 @@ <results> <test-suite type="TestFixture" name="CallsTest" executed="True" result="Success" success="True" time="0.009" asserts="0"> <results> - <test-case name="Google.GRPC.Core.Tests.CallsTest.Test1" executed="True" result="Success" success="True" time="0.004" asserts="0" /> + <test-case name="Grpc.Core.Tests.CallsTest.Test1" executed="True" result="Success" success="True" time="0.004" asserts="0" /> </results> </test-suite> <test-suite type="TestFixture" name="ClientServerTest" executed="True" result="Success" success="True" time="0.149" asserts="0"> <results> - <test-case name="Google.GRPC.Core.Tests.ClientServerTest.EmptyCall" executed="True" result="Success" success="True" time="0.111" asserts="0" /> + <test-case name="Grpc.Core.Tests.ClientServerTest.EmptyCall" executed="True" result="Success" success="True" time="0.111" asserts="0" /> </results> </test-suite> <test-suite type="TestFixture" name="ServerTest" executed="True" result="Success" success="True" time="0.001" asserts="0"> <results> - <test-case name="Google.GRPC.Core.Tests.ServerTest.StartAndShutdownServer" executed="True" result="Success" success="True" time="0.001" asserts="0" /> + <test-case name="Grpc.Core.Tests.ServerTest.StartAndShutdownServer" executed="True" result="Success" success="True" time="0.001" asserts="0" /> </results> </test-suite> </results> diff --git a/src/csharp/GrpcCoreTests/TimespecTest.cs b/src/csharp/GrpcCoreTests/TimespecTest.cs index 216982421918f1a1360c71ed0ce73017ff9644d0..0ca84ec44bfcdf38dec68e4c5dc360997fc96c06 100644 --- a/src/csharp/GrpcCoreTests/TimespecTest.cs +++ b/src/csharp/GrpcCoreTests/TimespecTest.cs @@ -32,11 +32,11 @@ #endregion using System; -using NUnit.Framework; using System.Runtime.InteropServices; -using Google.GRPC.Core.Internal; +using Grpc.Core.Internal; +using NUnit.Framework; -namespace Google.GRPC.Core.Internal.Tests +namespace Grpc.Core.Internal.Tests { public class TimespecTest { diff --git a/src/csharp/InteropClient/Client.cs b/src/csharp/InteropClient/Client.cs index 945afe0642f2e71688ace2a9e8daa60ed2a2ef7e..fdec6efd2ef2a3b26aad5a1afef7da2a6e5ec56d 100644 --- a/src/csharp/InteropClient/Client.cs +++ b/src/csharp/InteropClient/Client.cs @@ -33,14 +33,14 @@ using System; using System.Collections.Generic; -using NUnit.Framework; using System.Text.RegularExpressions; -using Google.GRPC.Core; -using Google.GRPC.Core.Utils; using Google.ProtocolBuffers; +using Grpc.Core; +using Grpc.Core.Utils; +using NUnit.Framework; using grpc.testing; -namespace Google.GRPC.Interop +namespace Grpc.Interop { class Client { diff --git a/src/csharp/InteropClient/InteropClient.csproj b/src/csharp/InteropClient/InteropClient.csproj index a450f3a2febb5d0818a4783f84548f3536f2c44a..29590f4950854927e98bb21a2b51ce1b30c710e9 100644 --- a/src/csharp/InteropClient/InteropClient.csproj +++ b/src/csharp/InteropClient/InteropClient.csproj @@ -9,7 +9,7 @@ <OutputType>Exe</OutputType> <RootNamespace>InteropClient</RootNamespace> <AssemblyName>InteropClient</AssemblyName> - <StartupObject>Google.GRPC.Interop.Client</StartupObject> + <StartupObject>Grpc.Interop.Client</StartupObject> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> @@ -33,14 +33,13 @@ <PlatformTarget>x86</PlatformTarget> </PropertyGroup> <ItemGroup> - <Reference Include="Google.ProtocolBuffers, Version=2.4.1.521, Culture=neutral, PublicKeyToken=55f7125234beb589, processorArchitecture=MSIL"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\packages\Google.ProtocolBuffers.2.4.1.521\lib\net40\Google.ProtocolBuffers.dll</HintPath> - </Reference> <Reference Include="nunit.framework"> <HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath> </Reference> <Reference Include="System" /> + <Reference Include="Google.ProtocolBuffers"> + <HintPath>..\packages\Google.ProtocolBuffers.2.4.1.521\lib\net40\Google.ProtocolBuffers.dll</HintPath> + </Reference> </ItemGroup> <ItemGroup> <Compile Include="Properties\AssemblyInfo.cs" /> diff --git a/src/csharp/MathClient/MathClient.cs b/src/csharp/MathClient/MathClient.cs index eb9b7b105b8aef0762a93cd002fdcd2cb1e714a5..95a4678bb8f63e623bd0c3a3c78688922fe7e07a 100644 --- a/src/csharp/MathClient/MathClient.cs +++ b/src/csharp/MathClient/MathClient.cs @@ -33,8 +33,8 @@ using System; using System.Runtime.InteropServices; -using Google.GRPC.Core; using System.Threading; +using Grpc.Core; namespace math {