CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2009
    Posts
    3

    question about WCF and TCP port sharing

    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?

  2. #2
    Join Date
    Mar 2004
    Location
    Prague, Czech Republic, EU
    Posts
    1,701

    Re: question about WCF and TCP port sharing

    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.
    • Make it run.
    • Make it right.
    • Make it fast.

    Don't hesitate to rate my post.

  3. #3
    Join Date
    Sep 2009
    Posts
    3

    Re: question about WCF and TCP port sharing

    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....

  4. #4
    Join Date
    Sep 2009
    Posts
    3

    Re: question about WCF and TCP port sharing

    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?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured