0

Been trying to research this question to no avail yet!.

Perhaps somebody can help.

I am trying to identify if localhost on a TS works in the same way as a straight server. If I have an application being launched in every TS session listening on a certain port will it fail or will it treat every RDP session as a separate localhost instance? Will to port fail to bind in more than one session or will it just treat every RDP session as a ringfenced environment?

Thanks

MadHatter
  • 79,770
  • 20
  • 184
  • 232
Peter Lee
  • 1
  • 1

2 Answers2

2

A service or application listener can bind to only one unique combination of host address and port.

If a given program instance binds to a specific ip address and a specific port on a host to listen for incoming connections, a second instance trying to bind to the same combination will fail.

Just as a thought you could solve this by implementing a connection broker intercepting the incoming connections on a given port and using one mechanism or other (proxying? redirecting?) passing these on to the correct unique application listener.

This assumes each terminal session user has the power to invoke a custom listener. Enabling that would be highly unusual sysadminship.

ErikE
  • 4,746
  • 1
  • 20
  • 27
  • Even if this is inside a Terminal Server session or a Citrix XenDesktop/XenApp Session? – Peter Lee Jun 30 '15 at 21:46
  • 2
    This has nothing to do with interactive or remote desktop sessions; socket binding is handled by the OS network stack, which is one and only for the whole server. – Massimo Jun 30 '15 at 21:46
  • Ok, thats where I got to with my research but just needed to make sure. Thanks for your time. – Peter Lee Jun 30 '15 at 21:48
  • @PeterLee There's a feature in 2008r2 called Session Virtual IP, that gives each session a different virtual IP - you might be able to use it, but that would mean you'll need to connect to each user on a different IP. – EliadTech Jul 01 '15 at 08:51
0

Actually there is a feature called Virtual Loopback in XenApp/XenDesktop. But it needs at least Windows Server 2008 R2.

And that's about all I know about it.

This is how Citrix says it works:

Enabling the Citrix virtual IP loopback policy settings allows each session to have its own loopback address for communication.

When an application uses the localhost address (default = 127.0.0.1) in a Winsock call, the virtual loopback feature simply replaces 127.0.0.1 with 127.X.X.X, where X.X.X is a representation of the session ID + 1.

For example, a session ID of 7 is 127.0.0.8. In the unlikely event that the session ID exceeds the fourth octet (more than 255), the address rolls over to the next octet (127.0.1.0), to the maximum of 127.255.255.255.

StackzOfZtuff
  • 1,842
  • 13
  • 21