David
David

Reputation: 2565

Can I run multiple TCP Listeners sharing a single port but different URIs

Is it possible to run multiple instances of a TCP Listener on the same port but with different listener URIs? E.g.

tcp://localhost:555/MyService1
tcp://localhost:555/MyService2

Context is Windows and .NET

Upvotes: -1

Views: 778

Answers (2)

Damien_The_Unbeliever
Damien_The_Unbeliever

Reputation: 239654

TCP is a low level protocol - it's just streams of bytes flowing in both directions, with the connection uniquely identified by the 4-tuple of (client IP address, client port, server IP address, server port).

If you want more than this, such as these high-falutin URIs that you speak of, it's up to you to a) switch to an existing higher level protocol that uses URIs and layers itself above TCP (e.g. HTTP), or b) for you to construct a higher level protocol that knows of URIs and layers itself above TCP.

In either (a) or (b) case though, at the TCP level, there's still only one listener.

Upvotes: 1

Radu
Radu

Reputation: 1031

At the application level it is possible, IIS SERVER with multiple web apps which are all on 80/443 ports is just one example.

But this can be done only at the application level.

So, it can be one listener should give all the packets to the application and from there will routed to different sub applications.

Hope it helps :)

Upvotes: 1

Related Questions