Skip to content

Commit

Permalink
last polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
Horusiath committed Feb 5, 2017
1 parent ccc1056 commit 5ac02e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 2 additions & 0 deletions src/core/Akka.Remote.Tests/RemoteConfigSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ public void Remoting_should_contain_correct_heliosTCP_values_in_ReferenceConf()
Assert.Equal(2, s.ClientSocketWorkerPoolSize);
Assert.False(s.BackwardsCompatibilityModeEnabled);
Assert.False(s.DnsUseIpv6);
Assert.False(s.LogTransport);
Assert.False(s.EnableSsl);
}

[Fact]
Expand Down
10 changes: 2 additions & 8 deletions src/core/Akka.Remote/Transport/DotNetty/TcpTransport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ namespace Akka.Remote.Transport.DotNetty
internal abstract class TcpHandlers : CommonHandlers
{
private IHandleEventListener listener;
protected readonly ByteOrder Order;

protected void NotifyListener(IHandleEvent msg)
{
Expand All @@ -33,7 +32,6 @@ protected void NotifyListener(IHandleEvent msg)

protected TcpHandlers(DotNettyTransport transport, ILoggingAdapter log) : base(transport, log)
{
Order = transport.Settings.ByteOrder;
}

protected override void RegisterListener(IChannel channel, IHandleEventListener listener, object msg, IPEndPoint remoteAddress)
Expand All @@ -54,7 +52,7 @@ public override void ChannelInactive(IChannelHandlerContext context)

public override void ChannelRead(IChannelHandlerContext context, object message)
{
var buf = ((IByteBuffer)message).WithOrder(Order);
var buf = ((IByteBuffer)message);
if (buf.ReadableBytes > 0)
{
// no need to copy the byte buffer contents; ByteString does that automatically
Expand Down Expand Up @@ -144,15 +142,11 @@ private void InitOutbound(IChannel channel, IPEndPoint socketAddress, object msg
internal sealed class TcpAssociationHandle : AssociationHandle
{
private readonly IChannel _channel;
private readonly DotNettyTransport _transport;
private readonly ByteOrder _order;

public TcpAssociationHandle(Address localAddress, Address remoteAddress, DotNettyTransport transport, IChannel channel)
: base(localAddress, remoteAddress)
{
_channel = channel;
_transport = transport;
_order = transport.Settings.ByteOrder;
}

public override bool Write(ByteString payload)
Expand All @@ -171,7 +165,7 @@ private IByteBuffer ToByteBuffer(ByteString payload)
//TODO: optimize DotNetty byte buffer usage
// (maybe custom IByteBuffer working directly on ByteString?)
var buffer = Unpooled.WrappedBuffer(payload.ToByteArray());
return buffer.WithOrder(_order);
return buffer;
}

public override void Disassociate()
Expand Down

0 comments on commit 5ac02e8

Please sign in to comment.