Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Remoting / February 2008

Tip: Looking for answers? Try searching our database.

Remoting on Terminal Server

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
tosch - 21 Feb 2008 12:31 GMT
I have to apps that communicate using remoting. This works fine on a
single machine.
When I run the same on a terminal server I get an error when
registering a channel, when the second client starts the application.
Why do I get this error? How can I resolve this Issue

Tosch
Nicolas Bouchard - 21 Feb 2008 14:05 GMT
> I have to apps that communicate using remoting. This works fine on a
> single machine.
[quoted text clipped - 3 lines]
>
> Tosch

The problem you have is due to the fact that you cannot open more than
1 port on the same computer.

I had the same situation lately.  The solution I used is quite
simple.  I get the session id from the terminal server and add it to
my port. That assure me I got a unique port for every session.  To get
the remoting session id use the following method:

     [System.Runtime.InteropServices.DllImport("kernel32.dll")]
     static extern bool ProcessIdToSessionId(uint dwProcessId, out
uint pSessionId);

     public long GetRemotingPort()
     {
        uint sessionId = 0;
        System.Diagnostics.Process currentProcess =
System.Diagnostics.Process.GetCurrentProcess();
        bool result = ProcessIdToSessionId((uint)currentProcess.Id,
out sessionId);
        return 65000 + sessionId;
     }

In this example, I removed all error trapping validation.  The base
port i was using is 65000 and if not on  a terminal server, the
ProcessIdToSessionId returns 0.

Nicolas Bouchard
tosch - 21 Feb 2008 14:47 GMT
On 21 Feb., 15:05, Nicolas Bouchard <nicolas.bouch...@gmail.com>
wrote:

> > I have to apps that communicate using remoting. This works fine on a
> > single machine.
[quoted text clipped - 31 lines]
>
> Nicolas Bouchard

Nicolas,
thanks for your good solution. Can the port number ever be to big?
What's the max for the session id?

Thomas
Nicolas Bouchard - 21 Feb 2008 15:12 GMT
> Nicolas,
> thanks for your good solution. Can the port number ever be to big?
[quoted text clipped - 3 lines]
>
> - Show quoted text -

The number maximum of session on terminal server depends on the
licensing used.  The minimum is 5 licenses.  The highest TCP port
available is 65535.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.