akka.net icon indicating copy to clipboard operation
akka.net copied to clipboard

Code samples in docs end abruptly

Open ghost opened this issue 5 years ago • 4 comments
trafficstars

In many sections code samples are clamped. For example, this code snippet from Networking section ends abruptly:

using System;
using System.Net;
using Akka.Actor;
using Akka.IO;

namespace DocsExamples.Networking.IO
{
    public class EchoServer : UntypedActor
    {
        public EchoServer(int port)
        {
            Context.System.Tcp().Tell(new Tcp.Bind(Self, new IPEndPoint(IPAddress.Any, port)));
        }

        protected override void OnReceive(object message)
        {
            if (message is Tcp.Bound)
            {
                var bound = message as Tcp.Bound;
                Console.WriteLine("Listening on {0}", bound.LocalAddress);
            }
            else if (message is Tcp.Connected)

ghost avatar Apr 12 '20 13:04 ghost

https://getakka.net/articles/testing/multi-node-testing.html here too

chris-sung avatar Apr 20 '21 05:04 chris-sung

cc @eaba

Aaronontheweb avatar Feb 01 '22 14:02 Aaronontheweb

In many sections code samples are clamped. For example, this code snippet from Networking section ends abruptly:

using System;
using System.Net;
using Akka.Actor;
using Akka.IO;

namespace DocsExamples.Networking.IO
{
    public class EchoServer : UntypedActor
    {
        public EchoServer(int port)
        {
            Context.System.Tcp().Tell(new Tcp.Bind(Self, new IPEndPoint(IPAddress.Any, port)));
        }

        protected override void OnReceive(object message)
        {
            if (message is Tcp.Bound)
            {
                var bound = message as Tcp.Bound;
                Console.WriteLine("Listening on {0}", bound.LocalAddress);
            }
            else if (message is Tcp.Connected)

@Aaronontheweb could not reproduce this issue - the issue may have to do with the console exiting before the EchoServer could start up. In that case Console.ReadLine(), will block the console from exiting!

Another possibility could be port unavailability.

image

I am unto the next issue, https://getakka.net/articles/testing/multi-node-testing.html in a bit!

eaba avatar Feb 04 '22 09:02 eaba

The MNTR docs are now up to date @eaba

Aaronontheweb avatar Feb 04 '22 12:02 Aaronontheweb