[go: nahoru, domu]

Skip to content

Commit

Permalink
Merge pull request #148 from jacqueskang/develop
Browse files Browse the repository at this point in the history
v3.0.3
  • Loading branch information
jacqueskang committed Jun 15, 2020
2 parents 45a82fb + c71e514 commit 1b99b47
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 20 deletions.
26 changes: 26 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#Contributing

## Git workflow

Follow [Gitflow](https://datasift.github.io/gitflow/IntroducingGitFlow.html).

*Notes:*
- Use **Rebase and merge** to complete PR merging to develop branch too have a clean and linear history.
- Use **Create a merge commit** to complete PR merging to master branch so that "first-parent" commits matches the versioning history.

## Commit syntax

Follow [Conventional Commits 1.0](https://www.conventionalcommits.org/en/v1.0.0/)

## Versioning

Follow [Semantic Versioning 2.0](https://semver.org/).

Currently all JKang.IpcServiceFramework.* packages share a same version fixed in [version.yml](/build/version.yml). You should thus update this file when starting working on a new milestone.

## CI/CD

- A PR build is triggered when any PR is created, which checks the changes included by executing all tests.
- A CI build is triggered when any change is commited in `develop` branch, which generates CI packages (e.g., *.3.0.0-ci-20200612.1.nupkg)
- A preview release build is triggered when any change is commited in `master` branch, which generates and publishes preview packages (e.g., *.3.0.0-preview-20200612.1.nupkg) to nuget.org
- To publish a stable release repository owner manually trigger a stable release build in Azure DevOps which generates stable packages and publishes to nuget.org (e.g., *.3.0.0.nupkg)
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@
A .NET Core 3.1 based lightweight framework for efficient inter-process communication.
Named pipeline and TCP support out-of-the-box, extensible with other protocols.

## NuGet packages
| Name | Purpose | Status |
| ---- | ------- | ------ |
| JKang.IpcServiceFramework.Client.NamedPipe | Client SDK to consume IPC service over Named pipe | [![NuGet version](https://badge.fury.io/nu/JKang.IpcServiceFramework.Client.NamedPipe.svg)](https://badge.fury.io/nu/JKang.IpcServiceFramework.Client.NamedPipe) |
| JKang.IpcServiceFramework.Client.Tcp | Client SDK to consume IPC service over TCP | [![NuGet version](https://badge.fury.io/nu/JKang.IpcServiceFramework.Client.Tcp.svg)](https://badge.fury.io/nu/JKang.IpcServiceFramework.Client.Tcp) |
| JKang.IpcServiceFramework.Hosting.NamedPipe | Server SDK to run Named pipe IPC service endpoint | [![NuGet version](https://badge.fury.io/nu/JKang.IpcServiceFramework.Hosting.NamedPipe.svg)](https://badge.fury.io/nu/JKang.IpcServiceFramework.Hosting.NamedPipe) |
| JKang.IpcServiceFramework.Hosting.Tcp | Server SDK to run TCP IPC service endpoint | [![NuGet version](https://badge.fury.io/nu/JKang.IpcServiceFramework.Hosting.Tcp.svg)](https://badge.fury.io/nu/JKang.IpcServiceFramework.Hosting.Tcp) |


## Usage

1. Create an interface as service contract and package it in an assembly to be referenced by server and client applications, for example:
Expand Down Expand Up @@ -92,15 +101,6 @@ Named pipeline and TCP support out-of-the-box, extensible with other protocols.
string output = await client.InvokeAsync(x => x.ReverseString(input));
```

## Downloads

IpcServiceFramework is available via NuGet packages:

- [JKang.IpcServiceFramework.Hosting.NamedPipe](https://www.nuget.org/packages/JKang.IpcServiceFramework.Hosting.NamedPipe/)
- [JKang.IpcServiceFramework.Client.NamedPipe](https://www.nuget.org/packages/JKang.IpcServiceFramework.Client.NamedPipe/)
- [JKang.IpcServiceFramework.Hosting.Tcp](https://www.nuget.org/packages/JKang.IpcServiceFramework.Hosting.Tcp/)
- [JKang.IpcServiceFramework.Client.Tcp](https://www.nuget.org/packages/JKang.IpcServiceFramework.Client.Tcp/)
## FAQs


14 changes: 7 additions & 7 deletions build/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ parameters:


variables:
- template: version.yml
- name: quality
${{ if parameters.stable }}:
value: 'stable'
${{ if not(parameters.stable) }}:
value: 'preview'
- template: version.yml
- name: quality
${{ if parameters.stable }}:
value: 'stable'
${{ if not(parameters.stable) }}:
value: 'preview'


name: $(version)-$(quality)$(Rev:.r)
Expand Down Expand Up @@ -56,4 +56,4 @@ steps:
git config --global user.email "fake@dev.azure.com"
git tag -a "v$(nugetVersion)" -m "v$(nugetVersion)"
git push origin "v$(nugetVersion)"
displayName: Tag source
displayName: Tag source
2 changes: 1 addition & 1 deletion build/version.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
variables:
version: '3.0.2'
version: '3.0.3'
6 changes: 3 additions & 3 deletions src/JKang.IpcServiceFramework.Core/IO/IpcReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ private async Task<byte[]> ReadMessageAsync(CancellationToken cancellationToken)
.ReadAsync(buffer, offset, count, cancellationToken)
.ConfigureAwait(false);

if (actualCount < count)
if (actualCount == 0)
{
throw new IpcCommunicationException("Stream closed unexpectedly.");
}

ms.Write(buffer, 0, count);
remainingBytes -= count;
ms.Write(buffer, 0, actualCount);
remainingBytes -= actualCount;
}
return ms.ToArray();
}
Expand Down
17 changes: 17 additions & 0 deletions src/JKang.IpcServiceFramework.NamedPipeTests/ContractTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Numerics;
using System.Threading.Tasks;
using Xunit;
Expand Down Expand Up @@ -85,6 +86,22 @@ public async Task ComplexTypeArray(IEnumerable<Complex> input, IEnumerable<Compl
Assert.Equal(expected, actual);
}

[Theory, AutoData]
public async Task LargeComplexTypeArray(Complex input, Complex expected)
{
IEnumerable<Complex> largeInput = Enumerable.Repeat(input, 1000);
IEnumerable<Complex> largeExpected = Enumerable.Repeat(expected, 100);

_serviceMock
.Setup(x => x.ComplexTypeArray(largeInput))
.Returns(largeExpected);

IEnumerable<Complex> actual = await _client
.InvokeAsync(x => x.ComplexTypeArray(largeInput));

Assert.Equal(largeExpected, actual);
}

[Fact]
public async Task ReturnVoid()
{
Expand Down

0 comments on commit 1b99b47

Please sign in to comment.