GithubHelp home page GithubHelp logo

Comments (5)

SamMousa avatar SamMousa commented on August 15, 2024

@clue As far as I can tell all Layer 4 protocols have a source and target port. How about adding a OsiLayer4ConnectionInterface for those? That would be a relatively simple extension and OSI layers are pretty well defined.

from socket.

clue avatar clue commented on August 15, 2024
C_a.remoteAddress = C_b.localAddress 
and 
C_a.localAddress = C_b.remoteAddress

I think this makes sense 👍 Though I'm not sure what you're suggesting we need to do? :)

When multiple connections are managed, both inbound and outbound, we need to "know" where the connection came from to decide which party we are (local or remote).

I'm not sure I follow, can you elaborate on this? You usually hold a reference to an instance representing the connection, so how exactly can these be mixed up?

How about adding a OsiLayer4ConnectionInterface […]

Care to elaborate on this? What's the motivation for this interface? What does this interface do that the ConnectionInterface is not capable of?

from socket.

SamMousa avatar SamMousa commented on August 15, 2024

I'd like to have a getSourceAddress and getTargetAddress although when thinking about it more, for unix sockets it could be argued that there is no real source address...

I'm not sure I follow, can you elaborate on this? You usually hold a reference to an instance representing the connection, so how exactly can these be mixed up?

I guess it depends on if you use the connection instance passed in the callback or the one you stored upon connection initiation.

Care to elaborate on this? What's the motivation for this interface? What does this interface do that the ConnectionInterface is not capable of?

It could expose things like the port which are part of the OSI 4 layer (afaik).

from socket.

clue avatar clue commented on August 15, 2024

I'm not sure I follow, can you elaborate on this? You usually hold a reference to an instance representing the connection, so how exactly can these be mixed up?

I guess it depends on if you use the connection instance passed in the callback or the one you stored upon connection initiation.

I'm still not sure I follow. Incoming and outgoing connections use different classes, as they're from different components. Using instanceof is much more reliable than checking the addresses (e.g. think of connections to localhost).

It could expose things like the port which are part of the OSI 4 layer (afaik).

You've got me confused, are we talking about #26 here? :-) If so, let's please move the discussion into a single ticket.

from socket.

SamMousa avatar SamMousa commented on August 15, 2024

Ok.

from socket.

Related Issues (20)

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.