Click to See Complete Forum and Search --> : question about WCF and TCP port sharing


shadowmaster2503
September 1st, 2009, 11:02 AM
h!

I have a general question. I do som worx on an app to make it fit for terminal servers. This app opens a TCP listener, so far, it works for one user. This is ok for a workstation, but on a terminalserver there are more than 1 instance of our program.

WCF has a service for port sharing, and I activated it.

Running the app in 2 sessions: one success, one failed.
Both apps tried to register a listener with this (example) URL:

/MyService

What happens if 2 apps register exactly the same URI? In theory I can register different URIs on the same port, but can I register two URI for the same port so both of the two processes receive the TCP data?

That what I know is that I have to add a line of Code:

bool portSharingEnabled = binding.PortSharingEnabled;

My question is:

will this work for more than one process if I use the same adress?

boudino
September 2nd, 2009, 01:49 AM
Are you sure you need more than one application running? WCF server often serves as... server, so 1 instance of running process to which many clients will connect should be enought, even in terminal session.

shadowmaster2503
September 2nd, 2009, 02:27 AM
there's a client server structure.

let's say the main app, called main.exe has some files to open it.
The main.exe should be controlled by a program control.exe
so the files of main.exe are associated to control.exe

somebody doubleklicks file.xxx, help.exe will be launched.
help.exe opens a port on 1234 and wants to talk to main.exe
if main.exe isn't present it will belaunched.

imo this is totally overkilled just for launching an app, it would be file if file.xxx is associated to main.exe instead to help.exe but it is not my decision.

For shure I could use virtual IP adresses on citrix....

shadowmaster2503
September 7th, 2009, 06:36 AM
I have changed the protocol to named pipes, because there "may" be a restriction to a desktop session. That's exactly what I wanted....

http://msdn.microsoft.com/en-us/library/ms733769.aspx

but MS keeps using the conjunctive of "to be", and it doesn't apply to desktop sessions on a terminal server.

Any other way to have a per-session process communication using WCF?