Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest of my changes are just making things nullable that can receive a null and marking A TON of classes as sealed given that they can't effectively be inherited.

Original file line number Diff line number Diff line change
Expand Up @@ -3977,10 +3977,9 @@ namespace Akka.IO
protected override void PostStop() { }
protected override bool Receive(object message) { }
}
public class Tcp : Akka.Actor.ExtensionIdProvider<Akka.IO.TcpExt>
public sealed class Tcp : Akka.Actor.ExtensionIdProvider<Akka.IO.TcpExt>
{
public static readonly Akka.Actor.SupervisorStrategy ConnectionSupervisorStrategy;
public static readonly Akka.IO.Tcp Instance;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be a breaking API change but this isn't how anyone uses Tcp - they almost all use the extension method. Wanted to get rid of this because it shouldn't be necessary, but both this and the Udp class were defined incorrectly from an ActorSystemExtension stand point and so this is a crutch for making it all work. Going to rework these more fully in v1.6 if I can make the time.

public Tcp() { }
public override Akka.IO.TcpExt CreateExtension(Akka.Actor.ExtendedActorSystem system) { }
public static Akka.Actor.IActorRef Manager(Akka.Actor.ActorSystem system) { }
Expand All @@ -3989,7 +3988,7 @@ namespace Akka.IO
public static readonly Akka.IO.Tcp.Abort Instance;
public override Akka.IO.Tcp.ConnectionClosed Event { get; }
}
public class Aborted : Akka.IO.Tcp.ConnectionClosed
public sealed class Aborted : Akka.IO.Tcp.ConnectionClosed
{
public static readonly Akka.IO.Tcp.Aborted Instance;
public override bool IsAborted { get; }
Expand All @@ -4004,13 +4003,13 @@ namespace Akka.IO
public bool PullMode { get; }
public override string ToString() { }
}
public class Bound : Akka.IO.Tcp.Event
public sealed class Bound : Akka.IO.Tcp.Event
{
public Bound(System.Net.EndPoint localAddress) { }
public System.Net.EndPoint LocalAddress { get; }
public override string ToString() { }
}
public class Close : Akka.IO.Tcp.CloseCommand
public sealed class Close : Akka.IO.Tcp.CloseCommand
{
public static readonly Akka.IO.Tcp.Close Instance;
public override Akka.IO.Tcp.ConnectionClosed Event { get; }
Expand All @@ -4020,7 +4019,7 @@ namespace Akka.IO
protected CloseCommand() { }
public abstract Akka.IO.Tcp.ConnectionClosed Event { get; }
}
public class Closed : Akka.IO.Tcp.ConnectionClosed
public sealed class Closed : Akka.IO.Tcp.ConnectionClosed
{
public static readonly Akka.IO.Tcp.Closed Instance;
}
Expand All @@ -4031,6 +4030,7 @@ namespace Akka.IO
}
public sealed class CommandFailed : Akka.IO.Tcp.Event
{
public CommandFailed(Akka.IO.Tcp.Command cmd, Akka.Util.Option<System.Exception> ex) { }
public CommandFailed(Akka.IO.Tcp.Command cmd) { }
public Akka.Util.Option<System.Exception> Cause { get; }
[Akka.Annotations.InternalApiAttribute()]
Expand All @@ -4040,25 +4040,25 @@ namespace Akka.IO
[Akka.Annotations.InternalApiAttribute()]
public Akka.IO.Tcp.CommandFailed WithCause(System.Exception cause) { }
}
public class CompoundWrite : Akka.IO.Tcp.WriteCommand, System.Collections.Generic.IEnumerable<Akka.IO.Tcp.SimpleWriteCommand>, System.Collections.IEnumerable
public sealed class CompoundWrite : Akka.IO.Tcp.WriteCommand, System.Collections.Generic.IEnumerable<Akka.IO.Tcp.SimpleWriteCommand>, System.Collections.IEnumerable
{
public CompoundWrite(Akka.IO.Tcp.SimpleWriteCommand head, Akka.IO.Tcp.WriteCommand tailCommand) { }
public Akka.IO.Tcp.SimpleWriteCommand Head { get; }
public Akka.IO.Tcp.WriteCommand TailCommand { get; }
public System.Collections.Generic.IEnumerator<Akka.IO.Tcp.SimpleWriteCommand> GetEnumerator() { }
public override string ToString() { }
}
public class ConfirmedClose : Akka.IO.Tcp.CloseCommand
public sealed class ConfirmedClose : Akka.IO.Tcp.CloseCommand
{
public static readonly Akka.IO.Tcp.ConfirmedClose Instance;
public override Akka.IO.Tcp.ConnectionClosed Event { get; }
}
public class ConfirmedClosed : Akka.IO.Tcp.ConnectionClosed
public sealed class ConfirmedClosed : Akka.IO.Tcp.ConnectionClosed
{
public static readonly Akka.IO.Tcp.ConfirmedClosed Instance;
public override bool IsConfirmed { get; }
}
public class Connect : Akka.IO.Tcp.Command
public sealed class Connect : Akka.IO.Tcp.Command
{
public Connect(System.Net.EndPoint remoteAddress, System.Net.EndPoint localAddress = null, System.Collections.Generic.IEnumerable<Akka.IO.Inet.SocketOption> options = null, System.Nullable<System.TimeSpan> timeout = null, bool pullMode = False) { }
public System.Net.EndPoint LocalAddress { get; }
Expand All @@ -4078,6 +4078,7 @@ namespace Akka.IO
public class ConnectionClosed : Akka.IO.Tcp.Event, Akka.Event.IDeadLetterSuppression
{
public ConnectionClosed() { }
[System.Runtime.CompilerServices.NullableAttribute(2)]
public virtual string Cause { get; }
public virtual bool IsAborted { get; }
public virtual bool IsConfirmed { get; }
Expand All @@ -4087,6 +4088,7 @@ namespace Akka.IO
public sealed class ErrorClosed : Akka.IO.Tcp.ConnectionClosed
{
public ErrorClosed(string cause) { }
[System.Runtime.CompilerServices.NullableAttribute(2)]
public override string Cause { get; }
public override bool IsErrorClosed { get; }
public override string ToString() { }
Expand All @@ -4106,7 +4108,7 @@ namespace Akka.IO
public object Token { get; }
public override string ToString() { }
}
public class PeerClosed : Akka.IO.Tcp.ConnectionClosed
public sealed class PeerClosed : Akka.IO.Tcp.ConnectionClosed
{
public static readonly Akka.IO.Tcp.PeerClosed Instance;
public override bool IsPeerClosed { get; }
Expand All @@ -4125,17 +4127,17 @@ namespace Akka.IO
public bool UseResumeWriting { get; }
public override string ToString() { }
}
public class ResumeAccepting : Akka.IO.Tcp.Command
public sealed class ResumeAccepting : Akka.IO.Tcp.Command
{
public ResumeAccepting(int batchSize) { }
public int BatchSize { get; }
public override string ToString() { }
}
public class ResumeReading : Akka.IO.Tcp.Command
public sealed class ResumeReading : Akka.IO.Tcp.Command
{
public static readonly Akka.IO.Tcp.ResumeReading Instance;
}
public class ResumeWriting : Akka.IO.Tcp.Command
public sealed class ResumeWriting : Akka.IO.Tcp.Command
{
public static readonly Akka.IO.Tcp.ResumeWriting Instance;
}
Expand All @@ -4146,19 +4148,19 @@ namespace Akka.IO
public bool WantsAck { get; }
public Akka.IO.Tcp.CompoundWrite Append(Akka.IO.Tcp.WriteCommand that) { }
}
public class SuspendReading : Akka.IO.Tcp.Command
public sealed class SuspendReading : Akka.IO.Tcp.Command
{
public static readonly Akka.IO.Tcp.SuspendReading Instance;
}
public class Unbind : Akka.IO.Tcp.Command
{
public static readonly Akka.IO.Tcp.Unbind Instance;
}
public class Unbound : Akka.IO.Tcp.Event
public sealed class Unbound : Akka.IO.Tcp.Event
{
public static readonly Akka.IO.Tcp.Unbound Instance;
}
public class Write : Akka.IO.Tcp.SimpleWriteCommand
public sealed class Write : Akka.IO.Tcp.SimpleWriteCommand
{
public static readonly Akka.IO.Tcp.Write Empty;
public override Akka.IO.Tcp.Event Ack { get; }
Expand All @@ -4175,7 +4177,7 @@ namespace Akka.IO
public Akka.IO.Tcp.CompoundWrite Prepend(Akka.IO.Tcp.SimpleWriteCommand other) { }
public Akka.IO.Tcp.WriteCommand Prepend(System.Collections.Generic.IEnumerable<Akka.IO.Tcp.WriteCommand> writes) { }
}
public class WritingResumed : Akka.IO.Tcp.Event
public sealed class WritingResumed : Akka.IO.Tcp.Event
{
public static readonly Akka.IO.Tcp.WritingResumed Instance;
}
Expand All @@ -4191,15 +4193,14 @@ namespace Akka.IO
{
public static Akka.Actor.IActorRef Tcp(this Akka.Actor.ActorSystem system) { }
}
public class TcpMessage
public class static TcpMessage
{
public TcpMessage() { }
public static Akka.IO.Tcp.Command Abort() { }
public static Akka.IO.Tcp.Command Bind(Akka.Actor.IActorRef handler, System.Net.EndPoint endpoint, int backlog, System.Collections.Generic.IEnumerable<Akka.IO.Inet.SocketOption> options, bool pullMode) { }
public static Akka.IO.Tcp.Command Bind(Akka.Actor.IActorRef handler, System.Net.EndPoint endpoint, int backlog) { }
public static Akka.IO.Tcp.Command Close() { }
public static Akka.IO.Tcp.Command ConfirmedClose() { }
public static Akka.IO.Tcp.Command Connect(System.Net.EndPoint remoteAddress, System.Net.EndPoint localAddress, System.Collections.Generic.IEnumerable<Akka.IO.Inet.SocketOption> options, System.Nullable<System.TimeSpan> timeout, bool pullMode) { }
public static Akka.IO.Tcp.Command Connect(System.Net.EndPoint remoteAddress, [System.Runtime.CompilerServices.NullableAttribute(2)] System.Net.EndPoint localAddress, System.Collections.Generic.IEnumerable<Akka.IO.Inet.SocketOption> options, System.Nullable<System.TimeSpan> timeout, bool pullMode) { }
public static Akka.IO.Tcp.Command Connect(System.Net.EndPoint remoteAddress) { }
public static Akka.IO.Tcp.NoAck NoAck(object token = null) { }
public static Akka.IO.Tcp.Command Register(Akka.Actor.IActorRef handler, bool keepOpenOnPeerClosed = False, bool useResumeWriting = True) { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3967,10 +3967,9 @@ namespace Akka.IO
protected override void PostStop() { }
protected override bool Receive(object message) { }
}
public class Tcp : Akka.Actor.ExtensionIdProvider<Akka.IO.TcpExt>
public sealed class Tcp : Akka.Actor.ExtensionIdProvider<Akka.IO.TcpExt>
{
public static readonly Akka.Actor.SupervisorStrategy ConnectionSupervisorStrategy;
public static readonly Akka.IO.Tcp Instance;
public Tcp() { }
public override Akka.IO.TcpExt CreateExtension(Akka.Actor.ExtendedActorSystem system) { }
public static Akka.Actor.IActorRef Manager(Akka.Actor.ActorSystem system) { }
Expand All @@ -3979,7 +3978,7 @@ namespace Akka.IO
public static readonly Akka.IO.Tcp.Abort Instance;
public override Akka.IO.Tcp.ConnectionClosed Event { get; }
}
public class Aborted : Akka.IO.Tcp.ConnectionClosed
public sealed class Aborted : Akka.IO.Tcp.ConnectionClosed
{
public static readonly Akka.IO.Tcp.Aborted Instance;
public override bool IsAborted { get; }
Expand All @@ -3994,13 +3993,13 @@ namespace Akka.IO
public bool PullMode { get; }
public override string ToString() { }
}
public class Bound : Akka.IO.Tcp.Event
public sealed class Bound : Akka.IO.Tcp.Event
{
public Bound(System.Net.EndPoint localAddress) { }
public System.Net.EndPoint LocalAddress { get; }
public override string ToString() { }
}
public class Close : Akka.IO.Tcp.CloseCommand
public sealed class Close : Akka.IO.Tcp.CloseCommand
{
public static readonly Akka.IO.Tcp.Close Instance;
public override Akka.IO.Tcp.ConnectionClosed Event { get; }
Expand All @@ -4010,7 +4009,7 @@ namespace Akka.IO
protected CloseCommand() { }
public abstract Akka.IO.Tcp.ConnectionClosed Event { get; }
}
public class Closed : Akka.IO.Tcp.ConnectionClosed
public sealed class Closed : Akka.IO.Tcp.ConnectionClosed
{
public static readonly Akka.IO.Tcp.Closed Instance;
}
Expand All @@ -4021,6 +4020,7 @@ namespace Akka.IO
}
public sealed class CommandFailed : Akka.IO.Tcp.Event
{
public CommandFailed(Akka.IO.Tcp.Command cmd, Akka.Util.Option<System.Exception> ex) { }
public CommandFailed(Akka.IO.Tcp.Command cmd) { }
public Akka.Util.Option<System.Exception> Cause { get; }
[Akka.Annotations.InternalApiAttribute()]
Expand All @@ -4030,25 +4030,25 @@ namespace Akka.IO
[Akka.Annotations.InternalApiAttribute()]
public Akka.IO.Tcp.CommandFailed WithCause(System.Exception cause) { }
}
public class CompoundWrite : Akka.IO.Tcp.WriteCommand, System.Collections.Generic.IEnumerable<Akka.IO.Tcp.SimpleWriteCommand>, System.Collections.IEnumerable
public sealed class CompoundWrite : Akka.IO.Tcp.WriteCommand, System.Collections.Generic.IEnumerable<Akka.IO.Tcp.SimpleWriteCommand>, System.Collections.IEnumerable
{
public CompoundWrite(Akka.IO.Tcp.SimpleWriteCommand head, Akka.IO.Tcp.WriteCommand tailCommand) { }
public Akka.IO.Tcp.SimpleWriteCommand Head { get; }
public Akka.IO.Tcp.WriteCommand TailCommand { get; }
public System.Collections.Generic.IEnumerator<Akka.IO.Tcp.SimpleWriteCommand> GetEnumerator() { }
public override string ToString() { }
}
public class ConfirmedClose : Akka.IO.Tcp.CloseCommand
public sealed class ConfirmedClose : Akka.IO.Tcp.CloseCommand
{
public static readonly Akka.IO.Tcp.ConfirmedClose Instance;
public override Akka.IO.Tcp.ConnectionClosed Event { get; }
}
public class ConfirmedClosed : Akka.IO.Tcp.ConnectionClosed
public sealed class ConfirmedClosed : Akka.IO.Tcp.ConnectionClosed
{
public static readonly Akka.IO.Tcp.ConfirmedClosed Instance;
public override bool IsConfirmed { get; }
}
public class Connect : Akka.IO.Tcp.Command
public sealed class Connect : Akka.IO.Tcp.Command
{
public Connect(System.Net.EndPoint remoteAddress, System.Net.EndPoint localAddress = null, System.Collections.Generic.IEnumerable<Akka.IO.Inet.SocketOption> options = null, System.Nullable<System.TimeSpan> timeout = null, bool pullMode = False) { }
public System.Net.EndPoint LocalAddress { get; }
Expand All @@ -4068,6 +4068,7 @@ namespace Akka.IO
public class ConnectionClosed : Akka.IO.Tcp.Event, Akka.Event.IDeadLetterSuppression
{
public ConnectionClosed() { }
[System.Runtime.CompilerServices.NullableAttribute(2)]
public virtual string Cause { get; }
public virtual bool IsAborted { get; }
public virtual bool IsConfirmed { get; }
Expand All @@ -4077,6 +4078,7 @@ namespace Akka.IO
public sealed class ErrorClosed : Akka.IO.Tcp.ConnectionClosed
{
public ErrorClosed(string cause) { }
[System.Runtime.CompilerServices.NullableAttribute(2)]
public override string Cause { get; }
public override bool IsErrorClosed { get; }
public override string ToString() { }
Expand All @@ -4096,7 +4098,7 @@ namespace Akka.IO
public object Token { get; }
public override string ToString() { }
}
public class PeerClosed : Akka.IO.Tcp.ConnectionClosed
public sealed class PeerClosed : Akka.IO.Tcp.ConnectionClosed
{
public static readonly Akka.IO.Tcp.PeerClosed Instance;
public override bool IsPeerClosed { get; }
Expand All @@ -4115,17 +4117,17 @@ namespace Akka.IO
public bool UseResumeWriting { get; }
public override string ToString() { }
}
public class ResumeAccepting : Akka.IO.Tcp.Command
public sealed class ResumeAccepting : Akka.IO.Tcp.Command
{
public ResumeAccepting(int batchSize) { }
public int BatchSize { get; }
public override string ToString() { }
}
public class ResumeReading : Akka.IO.Tcp.Command
public sealed class ResumeReading : Akka.IO.Tcp.Command
{
public static readonly Akka.IO.Tcp.ResumeReading Instance;
}
public class ResumeWriting : Akka.IO.Tcp.Command
public sealed class ResumeWriting : Akka.IO.Tcp.Command
{
public static readonly Akka.IO.Tcp.ResumeWriting Instance;
}
Expand All @@ -4136,19 +4138,19 @@ namespace Akka.IO
public bool WantsAck { get; }
public Akka.IO.Tcp.CompoundWrite Append(Akka.IO.Tcp.WriteCommand that) { }
}
public class SuspendReading : Akka.IO.Tcp.Command
public sealed class SuspendReading : Akka.IO.Tcp.Command
{
public static readonly Akka.IO.Tcp.SuspendReading Instance;
}
public class Unbind : Akka.IO.Tcp.Command
{
public static readonly Akka.IO.Tcp.Unbind Instance;
}
public class Unbound : Akka.IO.Tcp.Event
public sealed class Unbound : Akka.IO.Tcp.Event
{
public static readonly Akka.IO.Tcp.Unbound Instance;
}
public class Write : Akka.IO.Tcp.SimpleWriteCommand
public sealed class Write : Akka.IO.Tcp.SimpleWriteCommand
{
public static readonly Akka.IO.Tcp.Write Empty;
public override Akka.IO.Tcp.Event Ack { get; }
Expand All @@ -4165,7 +4167,7 @@ namespace Akka.IO
public Akka.IO.Tcp.CompoundWrite Prepend(Akka.IO.Tcp.SimpleWriteCommand other) { }
public Akka.IO.Tcp.WriteCommand Prepend(System.Collections.Generic.IEnumerable<Akka.IO.Tcp.WriteCommand> writes) { }
}
public class WritingResumed : Akka.IO.Tcp.Event
public sealed class WritingResumed : Akka.IO.Tcp.Event
{
public static readonly Akka.IO.Tcp.WritingResumed Instance;
}
Expand All @@ -4181,15 +4183,14 @@ namespace Akka.IO
{
public static Akka.Actor.IActorRef Tcp(this Akka.Actor.ActorSystem system) { }
}
public class TcpMessage
public class static TcpMessage
{
public TcpMessage() { }
public static Akka.IO.Tcp.Command Abort() { }
public static Akka.IO.Tcp.Command Bind(Akka.Actor.IActorRef handler, System.Net.EndPoint endpoint, int backlog, System.Collections.Generic.IEnumerable<Akka.IO.Inet.SocketOption> options, bool pullMode) { }
public static Akka.IO.Tcp.Command Bind(Akka.Actor.IActorRef handler, System.Net.EndPoint endpoint, int backlog) { }
public static Akka.IO.Tcp.Command Close() { }
public static Akka.IO.Tcp.Command ConfirmedClose() { }
public static Akka.IO.Tcp.Command Connect(System.Net.EndPoint remoteAddress, System.Net.EndPoint localAddress, System.Collections.Generic.IEnumerable<Akka.IO.Inet.SocketOption> options, System.Nullable<System.TimeSpan> timeout, bool pullMode) { }
public static Akka.IO.Tcp.Command Connect(System.Net.EndPoint remoteAddress, [System.Runtime.CompilerServices.NullableAttribute(2)] System.Net.EndPoint localAddress, System.Collections.Generic.IEnumerable<Akka.IO.Inet.SocketOption> options, System.Nullable<System.TimeSpan> timeout, bool pullMode) { }
public static Akka.IO.Tcp.Command Connect(System.Net.EndPoint remoteAddress) { }
public static Akka.IO.Tcp.NoAck NoAck(object token = null) { }
public static Akka.IO.Tcp.Command Register(Akka.Actor.IActorRef handler, bool keepOpenOnPeerClosed = False, bool useResumeWriting = True) { }
Expand Down
2 changes: 1 addition & 1 deletion src/core/Akka.Tests/IO/TcpListenerSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public ListenerParent(TestSetup test, bool pullMode)

_listener = Context.ActorOf(Props.Create(() =>
new TcpListener(
Tcp.Instance.Apply(Context.System),
Tcp.For(Context.System),
test._bindCommander.Ref,
new Tcp.Bind(
_test._handler.Ref,
Expand Down
Loading
Loading