aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/csharp/Grpc.Core
diff options
context:
space:
mode:
Diffstat (limited to 'src/csharp/Grpc.Core')
-rw-r--r--src/csharp/Grpc.Core/ChannelOptions.cs9
-rwxr-xr-xsrc/csharp/Grpc.Core/Common.csproj.include32
-rwxr-xr-x[-rw-r--r--]src/csharp/Grpc.Core/Grpc.Core.csproj201
-rw-r--r--src/csharp/Grpc.Core/Grpc.Core.project.json8
-rw-r--r--src/csharp/Grpc.Core/Grpc.Core.xproj18
-rw-r--r--src/csharp/Grpc.Core/Internal/AsyncCall.cs2
-rw-r--r--src/csharp/Grpc.Core/Internal/CompletionQueueSafeHandle.cs14
-rw-r--r--src/csharp/Grpc.Core/Internal/CompletionRegistry.cs18
-rw-r--r--src/csharp/Grpc.Core/Internal/GrpcThreadPool.cs2
-rw-r--r--src/csharp/Grpc.Core/Internal/NativeMethods.cs9
-rw-r--r--src/csharp/Grpc.Core/NativeDeps.Linux.csproj.include (renamed from src/csharp/Grpc.Core/NativeDeps.Linux.targets)6
-rw-r--r--src/csharp/Grpc.Core/NativeDeps.Mac.csproj.include17
-rw-r--r--src/csharp/Grpc.Core/NativeDeps.Mac.targets9
-rw-r--r--src/csharp/Grpc.Core/NativeDeps.Windows.csproj.include9
-rw-r--r--src/csharp/Grpc.Core/NativeDeps.Windows.targets9
-rwxr-xr-x[-rw-r--r--]src/csharp/Grpc.Core/NativeDeps.csproj.include (renamed from src/csharp/Grpc.Core/NativeDeps.targets)9
-rwxr-xr-xsrc/csharp/Grpc.Core/Version.csproj.include7
-rw-r--r--src/csharp/Grpc.Core/VersionInfo.cs4
-rw-r--r--src/csharp/Grpc.Core/packages.config4
-rw-r--r--src/csharp/Grpc.Core/project.json45
20 files changed, 177 insertions, 255 deletions
diff --git a/src/csharp/Grpc.Core/ChannelOptions.cs b/src/csharp/Grpc.Core/ChannelOptions.cs
index b6eeceabc4..46a2c6695f 100644
--- a/src/csharp/Grpc.Core/ChannelOptions.cs
+++ b/src/csharp/Grpc.Core/ChannelOptions.cs
@@ -151,7 +151,14 @@ namespace Grpc.Core
public const string MaxConcurrentStreams = "grpc.max_concurrent_streams";
/// <summary>Maximum message length that the channel can receive</summary>
- public const string MaxMessageLength = "grpc.max_message_length";
+ public const string MaxReceiveMessageLength = "grpc.max_receive_message_length";
+
+ /// <summary>Maximum message length that the channel can send</summary>
+ public const string MaxSendMessageLength = "grpc.max_send_message_length";
+
+ /// <summary>Obsolete, for backward compatibility only.</summary>
+ [Obsolete("Use MaxReceiveMessageLength instead.")]
+ public const string MaxMessageLength = MaxReceiveMessageLength;
/// <summary>Initial sequence number for http2 transports</summary>
public const string Http2InitialSequenceNumber = "grpc.http2.initial_sequence_number";
diff --git a/src/csharp/Grpc.Core/Common.csproj.include b/src/csharp/Grpc.Core/Common.csproj.include
new file mode 100755
index 0000000000..2cb990ba49
--- /dev/null
+++ b/src/csharp/Grpc.Core/Common.csproj.include
@@ -0,0 +1,32 @@
+<!-- Common definitions shared by all .csproj files -->
+<Project>
+ <PropertyGroup>
+ <GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
+ <GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
+ <GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
+ <GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
+ <GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
+ <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
+ <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
+ <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
+ <GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
+ </PropertyGroup>
+
+ <PropertyGroup>
+ <GenerateDocumentationFile>true</GenerateDocumentationFile>
+ </PropertyGroup>
+
+ <PropertyGroup>
+ <DefineConstants>$(DefineConstants);SIGNED</DefineConstants>
+ <AssemblyOriginatorKeyFile>../keys/Grpc.snk</AssemblyOriginatorKeyFile>
+ <SignAssembly>true</SignAssembly>
+ <PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
+ </PropertyGroup>
+
+ <PropertyGroup Condition="'$(OS)' != 'Windows_NT'">
+ <!-- Workaround for https://github.com/dotnet/sdk/issues/335 -->
+ <FrameworkPathOverride Condition="Exists('/usr/lib/mono/4.5-api')">/usr/lib/mono/4.5-api</FrameworkPathOverride>
+ <FrameworkPathOverride Condition="Exists('/usr/local/lib/mono/4.5-api')">/usr/local/lib/mono/4.5-api</FrameworkPathOverride>
+ <FrameworkPathOverride Condition="Exists('/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/4.5-api')">/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/4.5-api</FrameworkPathOverride>
+ </PropertyGroup>
+</Project>
diff --git a/src/csharp/Grpc.Core/Grpc.Core.csproj b/src/csharp/Grpc.Core/Grpc.Core.csproj
index d6d8dfac22..7e0f3f053d 100644..100755
--- a/src/csharp/Grpc.Core/Grpc.Core.csproj
+++ b/src/csharp/Grpc.Core/Grpc.Core.csproj
@@ -1,151 +1,68 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <Import Project="Version.csproj.include" />
+ <Import Project="Common.csproj.include" />
+
<PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProjectGuid>{CCC4440E-49F7-4790-B0AF-FEABB0837AE7}</ProjectGuid>
- <OutputType>Library</OutputType>
- <RootNamespace>Grpc.Core</RootNamespace>
+ <Copyright>Copyright 2015, Google Inc.</Copyright>
+ <AssemblyTitle>gRPC C# Core</AssemblyTitle>
+ <VersionPrefix>$(GrpcCsharpVersion)</VersionPrefix>
+ <Authors>Google Inc.</Authors>
+ <TargetFrameworks>net45;netstandard1.5</TargetFrameworks>
<AssemblyName>Grpc.Core</AssemblyName>
- <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
- <NuGetPackageImportStamp>c0512805</NuGetPackageImportStamp>
- <DocumentationFile>bin\$(Configuration)\Grpc.Core.Xml</DocumentationFile>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug</OutputPath>
- <DefineConstants>DEBUG;</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release</OutputPath>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
+ <PackageId>Grpc.Core</PackageId>
+ <PackageTags>gRPC RPC Protocol HTTP/2</PackageTags>
+ <PackageProjectUrl>https://github.com/grpc/grpc</PackageProjectUrl>
+ <PackageLicenseUrl>https://github.com/grpc/grpc/blob/master/LICENSE</PackageLicenseUrl>
+ <NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.5' ">1.6.0</NetStandardImplicitPackageVersion>
</PropertyGroup>
+
<ItemGroup>
- <Reference Include="System" />
- <Reference Include="System.Interactive.Async">
- <HintPath>..\packages\System.Interactive.Async.3.1.1\lib\net45\System.Interactive.Async.dll</HintPath>
- </Reference>
+ <EmbeddedResource Include="..\..\..\etc\roots.pem" />
+ <Content Include="..\nativelibs\macosx_x64\libgrpc_csharp_ext.dylib">
+ <PackagePath>runtimes/osx/native/libgrpc_csharp_ext.x64.dylib</PackagePath>
+ <Pack>true</Pack>
+ </Content>
+ <Content Include="..\nativelibs\macosx_x86\libgrpc_csharp_ext.dylib">
+ <PackagePath>runtimes/osx/native/libgrpc_csharp_ext.x86.dylib</PackagePath>
+ <Pack>true</Pack>
+ </Content>
+ <Content Include="..\nativelibs\linux_x64\libgrpc_csharp_ext.so">
+ <PackagePath>runtimes/linux/native/libgrpc_csharp_ext.x64.so</PackagePath>
+ <Pack>true</Pack>
+ </Content>
+ <Content Include="..\nativelibs\linux_x86\libgrpc_csharp_ext.so">
+ <PackagePath>runtimes/linux/native/libgrpc_csharp_ext.x86.so</PackagePath>
+ <Pack>true</Pack>
+ </Content>
+ <Content Include="..\nativelibs\windows_x64\grpc_csharp_ext.dll">
+ <PackagePath>runtimes/win/native/grpc_csharp_ext.x64.dll</PackagePath>
+ <Pack>true</Pack>
+ </Content>
+ <Content Include="..\nativelibs\windows_x86\grpc_csharp_ext.dll">
+ <PackagePath>runtimes/win/native/grpc_csharp_ext.x86.dll</PackagePath>
+ <Pack>true</Pack>
+ </Content>
+ <Content Include="Grpc.Core.targets">
+ <PackagePath>build/net45/</PackagePath>
+ <Pack>true</Pack>
+ </Content>
</ItemGroup>
+
<ItemGroup>
- <Compile Include="AsyncDuplexStreamingCall.cs" />
- <Compile Include="AsyncServerStreamingCall.cs" />
- <Compile Include="AsyncAuthInterceptor.cs" />
- <Compile Include="CallCredentials.cs" />
- <Compile Include="IClientStreamWriter.cs" />
- <Compile Include="Internal\NativeMethods.cs" />
- <Compile Include="Internal\PlatformApis.cs" />
- <Compile Include="Internal\NativeExtension.cs" />
- <Compile Include="Internal\UnmanagedLibrary.cs" />
- <Compile Include="Internal\NativeMetadataCredentialsPlugin.cs" />
- <Compile Include="Internal\INativeCall.cs" />
- <Compile Include="IServerStreamWriter.cs" />
- <Compile Include="IAsyncStreamWriter.cs" />
- <Compile Include="IAsyncStreamReader.cs" />
- <Compile Include="Logging\TextWriterLogger.cs" />
- <Compile Include="Logging\NullLogger.cs" />
- <Compile Include="ServerPort.cs" />
- <Compile Include="Version.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="RpcException.cs" />
- <Compile Include="Calls.cs" />
- <Compile Include="AsyncClientStreamingCall.cs" />
- <Compile Include="GrpcEnvironment.cs" />
- <Compile Include="Status.cs" />
- <Compile Include="StatusCode.cs" />
- <Compile Include="Server.cs" />
- <Compile Include="Channel.cs" />
- <Compile Include="Internal\CallSafeHandle.cs" />
- <Compile Include="Internal\ChannelSafeHandle.cs" />
- <Compile Include="Internal\CompletionQueueSafeHandle.cs" />
- <Compile Include="Internal\SafeHandleZeroIsInvalid.cs" />
- <Compile Include="Internal\Timespec.cs" />
- <Compile Include="Internal\GrpcThreadPool.cs" />
- <Compile Include="Internal\ServerSafeHandle.cs" />
- <Compile Include="Method.cs" />
- <Compile Include="Internal\ServerCallHandler.cs" />
- <Compile Include="Marshaller.cs" />
- <Compile Include="ServerServiceDefinition.cs" />
- <Compile Include="Utils\AsyncStreamExtensions.cs" />
- <Compile Include="Utils\BenchmarkUtil.cs" />
- <Compile Include="ChannelCredentials.cs" />
- <Compile Include="Internal\ChannelArgsSafeHandle.cs" />
- <Compile Include="Internal\AsyncCallBase.cs" />
- <Compile Include="Internal\AsyncCallServer.cs" />
- <Compile Include="Internal\AsyncCall.cs" />
- <Compile Include="Internal\ServerCredentialsSafeHandle.cs" />
- <Compile Include="ServerCredentials.cs" />
- <Compile Include="Metadata.cs" />
- <Compile Include="Internal\MetadataArraySafeHandle.cs" />
- <Compile Include="ClientBase.cs" />
- <Compile Include="Internal\ServerCalls.cs" />
- <Compile Include="ServerMethods.cs" />
- <Compile Include="Internal\ClientRequestStream.cs" />
- <Compile Include="Internal\ClientResponseStream.cs" />
- <Compile Include="Internal\ServerRequestStream.cs" />
- <Compile Include="Internal\ServerResponseStream.cs" />
- <Compile Include="Internal\AtomicCounter.cs" />
- <Compile Include="Internal\DebugStats.cs" />
- <Compile Include="ServerCallContext.cs" />
- <Compile Include="Internal\CompletionQueueEvent.cs" />
- <Compile Include="Internal\CompletionRegistry.cs" />
- <Compile Include="Internal\BatchContextSafeHandle.cs" />
- <Compile Include="ChannelOptions.cs" />
- <Compile Include="AsyncUnaryCall.cs" />
- <Compile Include="VersionInfo.cs" />
- <Compile Include="Internal\CStringSafeHandle.cs" />
- <Compile Include="KeyCertificatePair.cs" />
- <Compile Include="Logging\ILogger.cs" />
- <Compile Include="Logging\ConsoleLogger.cs" />
- <Compile Include="Internal\NativeLogRedirector.cs" />
- <Compile Include="ChannelState.cs" />
- <Compile Include="CallInvocationDetails.cs" />
- <Compile Include="CallOptions.cs" />
- <Compile Include="CompressionLevel.cs" />
- <Compile Include="WriteOptions.cs" />
- <Compile Include="ContextPropagationToken.cs" />
- <Compile Include="Internal\CallCredentialsSafeHandle.cs" />
- <Compile Include="Internal\ChannelCredentialsSafeHandle.cs" />
- <Compile Include="Profiling\ProfilerEntry.cs" />
- <Compile Include="Profiling\ProfilerScope.cs" />
- <Compile Include="Profiling\IProfiler.cs" />
- <Compile Include="Profiling\Profilers.cs" />
- <Compile Include="Internal\DefaultSslRootsOverride.cs" />
- <Compile Include="Utils\GrpcPreconditions.cs" />
- <Compile Include="CallInvoker.cs" />
- <Compile Include="DefaultCallInvoker.cs" />
- <Compile Include="Internal\UnimplementedCallInvoker.cs" />
- <Compile Include="Internal\InterceptingCallInvoker.cs" />
- <Compile Include="Internal\ServerRpcNew.cs" />
- <Compile Include="Internal\ClientSideStatus.cs" />
- <Compile Include="Internal\ClockType.cs" />
- <Compile Include="Internal\CallError.cs" />
- <Compile Include="Logging\LogLevel.cs" />
- <Compile Include="Logging\LogLevelFilterLogger.cs" />
- <Compile Include="Internal\RequestCallContextSafeHandle.cs" />
- <Compile Include="Utils\TaskUtils.cs" />
- <Compile Include="Internal\CallFlags.cs" />
- <Compile Include="AuthContext.cs" />
- <Compile Include="Internal\AuthContextSafeHandle.cs" />
- <Compile Include="Internal\MarshalUtils.cs" />
- <Compile Include="AuthProperty.cs" />
+ <PackageReference Include="System.Interactive.Async" Version="3.1.1" />
</ItemGroup>
- <ItemGroup>
- <None Include="Grpc.Core.project.json" />
- <None Include="packages.config" />
+
+ <ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
+ <Reference Include="System" />
+ <Reference Include="Microsoft.CSharp" />
</ItemGroup>
- <Import Project="NativeDeps.targets" />
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <ItemGroup />
- <ItemGroup>
- <EmbeddedResource Include="..\..\..\etc\roots.pem">
- <Link>roots.pem</Link>
- </EmbeddedResource>
+
+ <ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.5' ">
+ <PackageReference Include="System.Runtime.Loader" Version="4.0.0" />
+ <PackageReference Include="System.Threading.Thread" Version="4.0.0" />
</ItemGroup>
-</Project> \ No newline at end of file
+
+ <Import Project="NativeDeps.csproj.include" />
+
+</Project>
diff --git a/src/csharp/Grpc.Core/Grpc.Core.project.json b/src/csharp/Grpc.Core/Grpc.Core.project.json
deleted file mode 100644
index c2f5bcb163..0000000000
--- a/src/csharp/Grpc.Core/Grpc.Core.project.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "frameworks": {
- "net45": { }
- },
- "runtimes": {
- "win": { }
- }
-}
diff --git a/src/csharp/Grpc.Core/Grpc.Core.xproj b/src/csharp/Grpc.Core/Grpc.Core.xproj
deleted file mode 100644
index 137236ffdb..0000000000
--- a/src/csharp/Grpc.Core/Grpc.Core.xproj
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
- <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
- </PropertyGroup>
- <Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
- <PropertyGroup Label="Globals">
- <ProjectGuid>dc9908b6-f291-4fc8-a46d-2ea2551790ec</ProjectGuid>
- <RootNamespace>Grpc.Core</RootNamespace>
- <BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
- <OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
- </PropertyGroup>
- <PropertyGroup>
- <SchemaVersion>2.0</SchemaVersion>
- </PropertyGroup>
- <Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
-</Project> \ No newline at end of file
diff --git a/src/csharp/Grpc.Core/Internal/AsyncCall.cs b/src/csharp/Grpc.Core/Internal/AsyncCall.cs
index 1f738a3b6f..f037b2351a 100644
--- a/src/csharp/Grpc.Core/Internal/AsyncCall.cs
+++ b/src/csharp/Grpc.Core/Internal/AsyncCall.cs
@@ -87,7 +87,7 @@ namespace Grpc.Core.Internal
var profiler = Profilers.ForCurrentThread();
using (profiler.NewScope("AsyncCall.UnaryCall"))
- using (CompletionQueueSafeHandle cq = CompletionQueueSafeHandle.Create())
+ using (CompletionQueueSafeHandle cq = CompletionQueueSafeHandle.CreateSync())
{
byte[] payload = UnsafeSerialize(msg);
diff --git a/src/csharp/Grpc.Core/Internal/CompletionQueueSafeHandle.cs b/src/csharp/Grpc.Core/Internal/CompletionQueueSafeHandle.cs
index 6c9a31921e..577d7044a5 100644
--- a/src/csharp/Grpc.Core/Internal/CompletionQueueSafeHandle.cs
+++ b/src/csharp/Grpc.Core/Internal/CompletionQueueSafeHandle.cs
@@ -51,14 +51,20 @@ namespace Grpc.Core.Internal
{
}
- public static CompletionQueueSafeHandle Create()
+ /// <summary>
+ /// Create a completion queue that can only be used for Pluck operations.
+ /// </summary>
+ public static CompletionQueueSafeHandle CreateSync()
{
- return Native.grpcsharp_completion_queue_create();
+ return Native.grpcsharp_completion_queue_create_sync();
}
- public static CompletionQueueSafeHandle Create(CompletionRegistry completionRegistry)
+ /// <summary>
+ /// Create a completion queue that can only be used for Next operations.
+ /// </summary>
+ public static CompletionQueueSafeHandle CreateAsync(CompletionRegistry completionRegistry)
{
- var cq = Native.grpcsharp_completion_queue_create();
+ var cq = Native.grpcsharp_completion_queue_create_async();
cq.completionRegistry = completionRegistry;
return cq;
}
diff --git a/src/csharp/Grpc.Core/Internal/CompletionRegistry.cs b/src/csharp/Grpc.Core/Internal/CompletionRegistry.cs
index 7e2f0e9c6c..a4aa8d3ffe 100644
--- a/src/csharp/Grpc.Core/Internal/CompletionRegistry.cs
+++ b/src/csharp/Grpc.Core/Internal/CompletionRegistry.cs
@@ -51,7 +51,7 @@ namespace Grpc.Core.Internal
static readonly ILogger Logger = GrpcEnvironment.Logger.ForType<CompletionRegistry>();
readonly GrpcEnvironment environment;
- readonly ConcurrentDictionary<IntPtr, OpCompletionDelegate> dict = new ConcurrentDictionary<IntPtr, OpCompletionDelegate>();
+ readonly ConcurrentDictionary<IntPtr, OpCompletionDelegate> dict = new ConcurrentDictionary<IntPtr, OpCompletionDelegate>(new IntPtrComparer());
public CompletionRegistry(GrpcEnvironment environment)
{
@@ -121,5 +121,21 @@ namespace Grpc.Core.Internal
}
}
}
+
+ /// <summary>
+ /// IntPtr doesn't implement <c>IEquatable{IntPtr}</c> so we need to use custom comparer to avoid boxing.
+ /// </summary>
+ private class IntPtrComparer : IEqualityComparer<IntPtr>
+ {
+ public bool Equals(IntPtr x, IntPtr y)
+ {
+ return x == y;
+ }
+
+ public int GetHashCode(IntPtr obj)
+ {
+ return obj.GetHashCode();
+ }
+ }
}
}
diff --git a/src/csharp/Grpc.Core/Internal/GrpcThreadPool.cs b/src/csharp/Grpc.Core/Internal/GrpcThreadPool.cs
index 25a6589f11..07fea812b2 100644
--- a/src/csharp/Grpc.Core/Internal/GrpcThreadPool.cs
+++ b/src/csharp/Grpc.Core/Internal/GrpcThreadPool.cs
@@ -197,7 +197,7 @@ namespace Grpc.Core.Internal
for (int i = 0; i < completionQueueCount; i++)
{
var completionRegistry = new CompletionRegistry(environment);
- list.Add(CompletionQueueSafeHandle.Create(completionRegistry));
+ list.Add(CompletionQueueSafeHandle.CreateAsync(completionRegistry));
}
return list.AsReadOnly();
}
diff --git a/src/csharp/Grpc.Core/Internal/NativeMethods.cs b/src/csharp/Grpc.Core/Internal/NativeMethods.cs
index dd65f05217..a98861af61 100644
--- a/src/csharp/Grpc.Core/Internal/NativeMethods.cs
+++ b/src/csharp/Grpc.Core/Internal/NativeMethods.cs
@@ -115,7 +115,8 @@ namespace Grpc.Core.Internal
public readonly Delegates.grpcsharp_sizeof_grpc_event_delegate grpcsharp_sizeof_grpc_event;
- public readonly Delegates.grpcsharp_completion_queue_create_delegate grpcsharp_completion_queue_create;
+ public readonly Delegates.grpcsharp_completion_queue_create_async_delegate grpcsharp_completion_queue_create_async;
+ public readonly Delegates.grpcsharp_completion_queue_create_sync_delegate grpcsharp_completion_queue_create_sync;
public readonly Delegates.grpcsharp_completion_queue_shutdown_delegate grpcsharp_completion_queue_shutdown;
public readonly Delegates.grpcsharp_completion_queue_next_delegate grpcsharp_completion_queue_next;
public readonly Delegates.grpcsharp_completion_queue_pluck_delegate grpcsharp_completion_queue_pluck;
@@ -229,7 +230,8 @@ namespace Grpc.Core.Internal
this.grpcsharp_sizeof_grpc_event = GetMethodDelegate<Delegates.grpcsharp_sizeof_grpc_event_delegate>(library);
- this.grpcsharp_completion_queue_create = GetMethodDelegate<Delegates.grpcsharp_completion_queue_create_delegate>(library);
+ this.grpcsharp_completion_queue_create_async = GetMethodDelegate<Delegates.grpcsharp_completion_queue_create_async_delegate>(library);
+ this.grpcsharp_completion_queue_create_sync = GetMethodDelegate<Delegates.grpcsharp_completion_queue_create_sync_delegate>(library);
this.grpcsharp_completion_queue_shutdown = GetMethodDelegate<Delegates.grpcsharp_completion_queue_shutdown_delegate>(library);
this.grpcsharp_completion_queue_next = GetMethodDelegate<Delegates.grpcsharp_completion_queue_next_delegate>(library);
this.grpcsharp_completion_queue_pluck = GetMethodDelegate<Delegates.grpcsharp_completion_queue_pluck_delegate>(library);
@@ -383,7 +385,8 @@ namespace Grpc.Core.Internal
public delegate int grpcsharp_sizeof_grpc_event_delegate();
- public delegate CompletionQueueSafeHandle grpcsharp_completion_queue_create_delegate();
+ public delegate CompletionQueueSafeHandle grpcsharp_completion_queue_create_async_delegate();
+ public delegate CompletionQueueSafeHandle grpcsharp_completion_queue_create_sync_delegate();
public delegate void grpcsharp_completion_queue_shutdown_delegate(CompletionQueueSafeHandle cq);
public delegate CompletionQueueEvent grpcsharp_completion_queue_next_delegate(CompletionQueueSafeHandle cq);
public delegate CompletionQueueEvent grpcsharp_completion_queue_pluck_delegate(CompletionQueueSafeHandle cq, IntPtr tag);
diff --git a/src/csharp/Grpc.Core/NativeDeps.Linux.targets b/src/csharp/Grpc.Core/NativeDeps.Linux.csproj.include
index e0c9132b1d..e3bbeb071e 100644
--- a/src/csharp/Grpc.Core/NativeDeps.Linux.targets
+++ b/src/csharp/Grpc.Core/NativeDeps.Linux.csproj.include
@@ -1,9 +1,9 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project>
<ItemGroup>
<Content Include="..\..\..\libs\$(NativeDependenciesConfigurationUnix)\libgrpc_csharp_ext.so">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>libgrpc_csharp_ext.x64.so</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ <Pack>false</Pack>
</Content>
</ItemGroup>
</Project> \ No newline at end of file
diff --git a/src/csharp/Grpc.Core/NativeDeps.Mac.csproj.include b/src/csharp/Grpc.Core/NativeDeps.Mac.csproj.include
new file mode 100644
index 0000000000..f1b85c3730
--- /dev/null
+++ b/src/csharp/Grpc.Core/NativeDeps.Mac.csproj.include
@@ -0,0 +1,17 @@
+<Project>
+ <ItemGroup>
+ <!-- We are relying on run_tests.py to build grpc_csharp_ext with the right bitness
+ and we copy it as both x86 (needed by net45) and x64 (needed by netcoreapp1.0) as we don't
+ know which one will be needed to run the tests. -->
+ <Content Include="..\..\..\libs\$(NativeDependenciesConfigurationUnix)\libgrpc_csharp_ext.dylib">
+ <Link>libgrpc_csharp_ext.x86.dylib</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ <Pack>false</Pack>
+ </Content>
+ <Content Include="..\..\..\libs\$(NativeDependenciesConfigurationUnix)\libgrpc_csharp_ext.dylib">
+ <Link>libgrpc_csharp_ext.x64.dylib</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ <Pack>false</Pack>
+ </Content>
+ </ItemGroup>
+</Project>
diff --git a/src/csharp/Grpc.Core/NativeDeps.Mac.targets b/src/csharp/Grpc.Core/NativeDeps.Mac.targets
deleted file mode 100644
index e22c7384fc..0000000000
--- a/src/csharp/Grpc.Core/NativeDeps.Mac.targets
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <Content Include="..\..\..\libs\$(NativeDependenciesConfigurationUnix)\libgrpc_csharp_ext.dylib">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <Link>libgrpc_csharp_ext.x86.dylib</Link>
- </Content>
- </ItemGroup>
-</Project> \ No newline at end of file
diff --git a/src/csharp/Grpc.Core/NativeDeps.Windows.csproj.include b/src/csharp/Grpc.Core/NativeDeps.Windows.csproj.include
new file mode 100644
index 0000000000..04f3b077ac
--- /dev/null
+++ b/src/csharp/Grpc.Core/NativeDeps.Windows.csproj.include
@@ -0,0 +1,9 @@
+<Project>
+ <ItemGroup>
+ <Content Include="..\..\..\cmake\build\x64\$(NativeDependenciesConfiguration)\grpc_csharp_ext.dll">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ <Link>grpc_csharp_ext.x64.dll</Link>
+ <Pack>false</Pack>
+ </Content>
+ </ItemGroup>
+</Project>
diff --git a/src/csharp/Grpc.Core/NativeDeps.Windows.targets b/src/csharp/Grpc.Core/NativeDeps.Windows.targets
deleted file mode 100644
index 623f58b95b..0000000000
--- a/src/csharp/Grpc.Core/NativeDeps.Windows.targets
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <Content Include="..\..\..\cmake\build\Win32\$(NativeDependenciesConfiguration)\grpc_csharp_ext.dll">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <Link>grpc_csharp_ext.x86.dll</Link>
- </Content>
- </ItemGroup>
-</Project> \ No newline at end of file
diff --git a/src/csharp/Grpc.Core/NativeDeps.targets b/src/csharp/Grpc.Core/NativeDeps.csproj.include
index e187f72d26..a62c63e11d 100644..100755
--- a/src/csharp/Grpc.Core/NativeDeps.targets
+++ b/src/csharp/Grpc.Core/NativeDeps.csproj.include
@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<!-- Ensures that native libraries are copied to the output directory for Exe targets -->
+<Project>
<PropertyGroup Condition=" '$(NativeDependenciesConfiguration)' == '' ">
<NativeDependenciesConfiguration Condition=" '$(Configuration)' == 'Debug' ">Debug</NativeDependenciesConfiguration>
@@ -22,5 +22,6 @@
<NativeDepsPlatform>Linux</NativeDepsPlatform>
</PropertyGroup>
- <Import Project="NativeDeps.$(NativeDepsPlatform).targets" />
-</Project> \ No newline at end of file
+ <Import Project="NativeDeps.$(NativeDepsPlatform).csproj.include" />
+
+</Project>
diff --git a/src/csharp/Grpc.Core/Version.csproj.include b/src/csharp/Grpc.Core/Version.csproj.include
new file mode 100755
index 0000000000..6af2af10bd
--- /dev/null
+++ b/src/csharp/Grpc.Core/Version.csproj.include
@@ -0,0 +1,7 @@
+<!-- This file is generated -->
+<Project>
+ <PropertyGroup>
+ <GrpcCsharpVersion>1.4.0-dev</GrpcCsharpVersion>
+ <GoogleProtobufVersion>3.2.0</GoogleProtobufVersion>
+ </PropertyGroup>
+</Project>
diff --git a/src/csharp/Grpc.Core/VersionInfo.cs b/src/csharp/Grpc.Core/VersionInfo.cs
index 6012d904b6..2e55d9d80e 100644
--- a/src/csharp/Grpc.Core/VersionInfo.cs
+++ b/src/csharp/Grpc.Core/VersionInfo.cs
@@ -48,11 +48,11 @@ namespace Grpc.Core
/// <summary>
/// Current <c>AssemblyFileVersion</c> of gRPC C# assemblies
/// </summary>
- public const string CurrentAssemblyFileVersion = "1.3.0.0";
+ public const string CurrentAssemblyFileVersion = "1.4.0.0";
/// <summary>
/// Current version of gRPC C#
/// </summary>
- public const string CurrentVersion = "1.3.0-dev";
+ public const string CurrentVersion = "1.4.0-dev";
}
}
diff --git a/src/csharp/Grpc.Core/packages.config b/src/csharp/Grpc.Core/packages.config
deleted file mode 100644
index 53cfad52f0..0000000000
--- a/src/csharp/Grpc.Core/packages.config
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<packages>
- <package id="System.Interactive.Async" version="3.1.1" targetFramework="net45" />
-</packages> \ No newline at end of file
diff --git a/src/csharp/Grpc.Core/project.json b/src/csharp/Grpc.Core/project.json
deleted file mode 100644
index a1306baa87..0000000000
--- a/src/csharp/Grpc.Core/project.json
+++ /dev/null
@@ -1,45 +0,0 @@
-{
- "version": "1.3.0-dev",
- "title": "gRPC C# Core",
- "authors": [ "Google Inc." ],
- "copyright": "Copyright 2015, Google Inc.",
- "packOptions": {
- "summary": "Core C# implementation of gRPC - an RPC library and framework",
- "description": "Core C# implementation of gRPC - an RPC library and framework. See project site for more info.",
- "owners": [ "grpc-packages" ],
- "licenseUrl": "https://github.com/grpc/grpc/blob/master/LICENSE",
- "projectUrl": "https://github.com/grpc/grpc",
- "requireLicenseAcceptance": false,
- "tags": [ "gRPC RPC Protocol HTTP/2" ],
- "files": {
- "mappings": {
- "build/net45/": "Grpc.Core.targets",
- "runtimes/win/native/grpc_csharp_ext.x86.dll": "../nativelibs/windows_x86/grpc_csharp_ext.dll",
- "runtimes/win/native/grpc_csharp_ext.x64.dll": "../nativelibs/windows_x64/grpc_csharp_ext.dll",
- "runtimes/linux/native/libgrpc_csharp_ext.x86.so": "../nativelibs/linux_x86/libgrpc_csharp_ext.so",
- "runtimes/linux/native/libgrpc_csharp_ext.x64.so": "../nativelibs/linux_x64/libgrpc_csharp_ext.so",
- "runtimes/osx/native/libgrpc_csharp_ext.x86.dylib": "../nativelibs/macosx_x86/libgrpc_csharp_ext.dylib",
- "runtimes/osx/native/libgrpc_csharp_ext.x64.dylib": "../nativelibs/macosx_x64/libgrpc_csharp_ext.dylib"
- }
- }
- },
- "buildOptions": {
- "embed": [ "../../../etc/roots.pem" ],
- "define": [ "SIGNED" ],
- "keyFile": "../keys/Grpc.snk",
- "xmlDoc": true
- },
- "dependencies": {
- "System.Interactive.Async": "3.1.1"
- },
- "frameworks": {
- "net45": { },
- "netstandard1.5": {
- "dependencies": {
- "NETStandard.Library": "1.6.0",
- "System.Runtime.Loader": "4.0.0",
- "System.Threading.Thread": "4.0.0"
- }
- }
- }
-}