Giter VIP home page Giter VIP logo

Comments (4)

izavala avatar izavala commented on June 24, 2024 1

Currently the issue that we are seeing with the current setup is:

  • Sockets are being opened and we are binding to them, but we are not accepting the connection.
  • This will hold the resource and will cause the sockets to timeout and close.
  • Once a connection is made, we are not acknowledging that we have handled the connection request.

How to resolve the issue:

  • Will implement Akka.io to bind to the Tcp port.
  • Once we receive a Tcp.connected message we will respond with a small message.
  • After sending the message we will want to close the connection and get back to the listening state.

from akkadotnet-healthcheck.

izavala avatar izavala commented on June 24, 2024

It looks like using Akka.io may complicate this process as SocketStatusTransport is not an actor and we will not be able to pass it through as an ActorRef.

Using the AccpetAsync socket function and handling these request through Tasks may be an easier implementation.

from akkadotnet-healthcheck.

izavala avatar izavala commented on June 24, 2024

From looking at the implementation of LivenessTransportActor, it waits for the SocketStatusTransport to open the connection and respond with a TransporWriteStatus(True) message if no exceptions are encountered.

After we have an initial bind with the socket, we would then create a temporary connection to echo the message back and close it immediately after to accept queued connections.

Adding
var handler = await _socket.AcceptAsync();
byte[] msg = Encoding.ASCII.GetBytes("Live");
handler.Send(msg);
handler.Shutdown(SocketShutdown.Both);
handler.Close();

between the if statement and the exception would allow the connection request to come through and close once it has been acknowledged?

https://github.com/izavala/akkadotnet-healthcheck/blob/85ef553f8ef5c98f1dee3a081003c75668ce93da/src/Akka.HealthCheck/Transports/Sockets/SocketStatusTransport.cs#L33-L40

from akkadotnet-healthcheck.

Aaronontheweb avatar Aaronontheweb commented on June 24, 2024

closed via #25

from akkadotnet-healthcheck.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.