vlingo-net / xoom-net-wire Goto Github PK
View Code? Open in Web Editor NEWWire protocol messaging implementations, such as with full-duplex TCP and UDP multicast, using VLINGO/ACTORS on .NET.
License: Mozilla Public License 2.0
Wire protocol messaging implementations, such as with full-duplex TCP and UDP multicast, using VLINGO/ACTORS on .NET.
License: Mozilla Public License 2.0
The goal is to use new C#8 features like default interface implementation and nullable types which helps a lot porting java code to .net.
SocketChannelWriter
attempts to write when the internal socket was closed or disconnected.
Icing on a cake, Write
and Read
methods on Stream
s can be also done asynchronously for better throughput.
The log from the test : https://travis-ci.org/vlingo-net/vlingo-net-wire/jobs/601331813
A total of 1 test files matched the specified pattern.
The active test run was aborted. Reason: Test host process crashed : Unhandled exception. Unhandled exception. Unhandled exception. System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.
at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult, SocketError& errorCode)
at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
at Vlingo.Wire.Fdx.Bidirectional.BasicClientRequestResponseChannel.ReceiveCallback(IAsyncResult ar) in /Users/travis/build/vlingo-net/vlingo-net-wire/src/Vlingo.Wire/Fdx/Bidirectional/BasicClientRequestResponseChannel.cs:line 279
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Net.ContextAwareResult.CompleteCallback()
at System.Net.ContextAwareResult.<>c.<Complete>b__15_0(Object s)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Net.ContextAwareResult.Complete(IntPtr userToken)
at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
at System.Net.Sockets.BaseOverlappedAsyncResult.CompletionCallback(Int32 numBytes, SocketError errorCode)
at System.Net.Sockets.OverlappedAsyncResult.CompletionCallback(Int32 numBytes, Byte[] socketAddress, Int32 socketAddressSize, SocketFlags receivedFlags, SocketError errorCode)
at System.Net.Sockets.SocketAsyncContext.BufferMemoryReceiveOperation.InvokeCallback(Boolean allowPooling)
at System.Net.Sockets.SocketAsyncContext.AsyncOperation.<>c.<TryCancel>b__18_0(Object o)
at System.Threading.QueueUserWorkItemCallbackDefaultContext.Execute()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.
at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult, SocketError& errorCode)
at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
at Vlingo.Wire.Fdx.Bidirectional.BasicClientRequestResponseChannel.ReceiveCallback(IAsyncResult ar) in /Users/travis/build/vlingo-net/vlingo-net-wire/src/Vlingo.Wire/Fdx/Bidirectional/BasicClientRequestResponseChannel.cs:line 279
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Net.ContextAwareResult.CompleteCallback()
at System.Net.ContextAwareResult.<>c.<Complete>b__15_0(Object s)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Net.ContextAwareResult.Complete(IntPtr userToken)
at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
at System.Net.Sockets.BaseOverlappedAsyncResult.CompletionCallback(Int32 numBytes, SocketError errorCode)
at System.Net.Sockets.OverlappedAsyncResult.CompletionCallback(Int32 numBytes, Byte[] socketAddress, Int32 socketAddressSize, SocketFlags receivedFlags, SocketError errorCode)
at System.Net.Sockets.SocketAsyncContext.BufferMemoryReceiveOperation.InvokeCallback(Boolean allowPooling)
at System.Net.Sockets.SocketAsyncContext.AsyncOperation.<>c.<TryCancel>b__18_0(Object o)
at System.Threading.QueueUserWorkItemCallbackDefaultContext.Execute()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
Unhandled exception. System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.
at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult, SocketError& errorCode)
at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
at Vlingo.Wire.Fdx.Bidirectional.BasicClientRequestResponseChannel.ReceiveCallback(IAsyncResult ar) in /Users/travis/build/vlingo-net/vlingo-net-wire/src/Vlingo.Wire/Fdx/Bidirectional/BasicClientRequestResponseChannel.cs:line 279
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Net.ContextAwareResult.CompleteCallback()
at System.Net.ContextAwareResult.<>c.<Complete>b__15_0(Object s)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Net.ContextAwareResult.Complete(IntPtr userToken)
at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
at System.Net.Sockets.BaseOverlappedAsyncResult.CompletionCallback(Int32 numBytes, SocketError errorCode)
at System.Net.Sockets.OverlappedAsyncResult.CompletionCallback(Int32 numBytes, Byte[] socketAddress, Int32 socketAddressSize, SocketFlags receivedFlags, SocketError errorCode)
at System.Net.Sockets.SocketAsyncContext.BufferMemoryReceiveOperation.InvokeCallback(Boolean allowPooling)
at System.Net.Sockets.SocketAsyncContext.AsyncOperation.<>c.<TryCancel>b__18_0(Object o)
at System.Threading.QueueUserWorkItemCallbackDefaultContext.Execute()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
Unhandled exception. System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.
at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult, SocketError& errorCode)
at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
at Vlingo.Wire.Fdx.Bidirectional.BasicClientRequestResponseChannel.ReceiveCallback(IAsyncResult ar) in /Users/travis/build/vlingo-net/vlingo-net-wire/src/Vlingo.Wire/Fdx/Bidirectional/BasicClientRequestResponseChannel.cs:line 279
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Net.ContextAwareResult.CompleteCallback()
at System.Net.ContextAwareResult.<>c.<Complete>b__15_0(Object s)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Net.ContextAwareResult.Complete(IntPtr userToken)
at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
at System.Net.Sockets.BaseOverlappedAsyncResult.CompletionCallback(Int32 numBytes, SocketError errorCode)
at System.Net.Sockets.OverlappedAsyncResult.CompletionCallback(Int32 numBytes, Byte[] socketAddress, Int32 socketAddressSize, SocketFlags receivedFlags, SocketError errorCode)
at System.Net.Sockets.SocketAsyncContext.BufferMemoryReceiveOperation.InvokeCallback(Boolean allowPooling)
at System.Net.Sockets.SocketAsyncContext.AsyncOperation.<>c.<TryCancel>b__18_0(Object o)
at System.Threading.QueueUserWorkItemCallbackDefaultContext.Execute()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
Test run in progress.Test Run Aborted.
Total tests: Unknown
Passed: 15
Total time: 14.4311 Seconds
The command "dotnet restore ./src/Vlingo.Wire.sln; dotnet build ./src/Vlingo.Wire.sln; dotnet test ./src/Vlingo.Wire.Tests/Vlingo.Wire.Tests.csproj;" exited with 1.
Done. Your build exited with 1.
Based on Java reference implementation:
Task
Note: This is postponed because RSocket
doesn't support Aeron for now. The main reason of introducing it on Java side.
MulticastChannelPublisher doesn't receive messages from multiple clients when listening on a port. This is probably due from the fact that each client connection should be accepter before it can be processed.
SocketChannelWriter
is synchronous today because its Write
method signature is returning an interesting` about the number of bytes read. But for asynchronous operation it cannot be returned straight away, only on received callback.
There are two solutions (or more):
TestUntil
is not very good for concurrent testing and all tests using it should be rewritten to AccessSafely
This should eliminate dangerous conversions from Stream to MemoryStream
From time to time TestInbound
fails with the following message:
Assert.Equal() Failure
↓ (pos 8)
Expected: Message-1
Actual: Message-2
↑ (pos 8)
at:
at Vlingo.Wire.Tests.Fdx.Inbound.InboundStreamTest.TestInbound() in C:\projects\vlingo-net-wire\src\Vlingo.Wire.Tests\Fdx\Inbound\InboundStreamTest.cs:line 36
More details here: https://ci.appveyor.com/project/VlingoNetOwner/vlingo-net-wire/builds/23642914/tests
Instead of managing buffers manually, and all overhead it adds to work with sockets, .NET core community pushes towards using of System.IO.Pipelines
which should be more performant, easier to understand and deals with built in features like back-pressure.
Related to #57
According to the following template
language: csharp
jobs:
include:
- os: linux
dotnet: 3.0.100
mono: none
- os: osx
osx_image: xcode11
dotnet: 3.0.100
mono: none
sudo: false # use the new container-based Travis infrastructure
script:
- dotnet restore ./src/Vlingo.UUID.sln;
dotnet build ./src/Vlingo.UUID.sln;
dotnet test ./src/Vlingo.UUID.Tests/Vlingo.UUID.Tests.csproj;
notifications:
slack: vlingo-platform-net:kwiEEBuUpRnz2rYYYstTBpXr
Related to #57
Make changes according to this template
version: 0.0.{build}
image:
- Visual Studio 2019
- Ubuntu
configuration: Release
skip_commits:
message: /.*\[ci\-skip\].*/
before_build:
- dotnet restore src/Vlingo.UUID.sln
build:
project: src/Vlingo.UUID.sln
verbosity: minimal
publish_nuget: true
test_script:
- dotnet test src/Vlingo.UUID.Tests
deploy:
- provider: NuGet
api_key:
secure: keYt7U6hDEIBzKLfVMts/6deGh0bqJdcjhlO2mWEJ04SRIS0Y6+e3EjszsRqq5nJ
skip_symbols: true
artifact: /.*\.nupkg/
on:
branch: master
notifications:
- provider: Webhook
url: https://webhooks.gitter.im/e/2b56d1ca84637acb9ee8
method: POST
on_build_success: true
on_build_failure: true
on_build_status_changed: true
This is environment specific, on my machine the test TestMulticastPublishSubscribe
fails because it can not find appropriate network interface.
In the following UT, RawMessage.CopyBytesTo
is wrong because when parsing to text we have a discrepancy where the parsed text should equal to expected
:
Assert.Equal() Failure
↓ (pos 0)
Expected: JOIN\nid=1 nm=node1 op=localhost:35745 app···
Actual: ����JOIN\nid=1 nm=node1 op=localhost:35745···
↑ (pos 0)
There are two extra characters.
This is for the purpose of tracking the missing feature compared to java version. It is about ApplicationOutboundStreamActor
which seems not used inside the wire
but should be implemented if used in external lib.
ProcessChannel doesn't check for messages on read channel. Lacking implementation.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.