Terminal Services

General development discussion.

Moderators: Susan Smith, admin, Gabriel

Post Reply
gtisdale
Posts: 218
Joined: Sun Jun 07, 2009 7:54 am
Location: Concord, Massachusetts
Contact:

Terminal Services

Post by gtisdale »

When I log onto my office computer from outside, the computer knows that I am outside and any grapic background for the desk top is deactivated with a black background. This is good because my remote sessions run faster.

The computer somehow knows that it is being accessed remotely. Is there a way that my BR sessions can know the same thing, like through an env$ variable, and I can deactivate some of the graphics that are used in menus or other programs that look nice when running, but slow down remote sessions?
bluesfannoz
Posts: 291
Joined: Fri Jun 19, 2009 9:01 am
Location: Lawrence, Kansas
Contact:

Re: Terminal Services

Post by bluesfannoz »

I believe ENV$("SESSIONNAME") should have something in it when your connected.
gtisdale wrote:When I log onto my office computer from outside, the computer knows that I am outside and any grapic background for the desk top is deactivated with a black background. This is good because my remote sessions run faster.

The computer somehow knows that it is being accessed remotely. Is there a way that my BR sessions can know the same thing, like through an env$ variable, and I can deactivate some of the graphics that are used in menus or other programs that look nice when running, but slow down remote sessions?
Steve Koger
Computer Specialist
SEKESC-MACS Division
gtisdale
Posts: 218
Joined: Sun Jun 07, 2009 7:54 am
Location: Concord, Massachusetts
Contact:

Post by gtisdale »

I'll give it some more tests, but I see that env$("SESSIONNAME") returns "Console" when I am directly connected and "RDP-Tcp#2" when connected using terminal services.
For the time being then I'm going to display the graphics only of ENV$("SESSIONNAME")="Console"

This is on a Windows network NOT running client server.

Thank you Steve.
Susan Smith
Posts: 717
Joined: Sun Aug 10, 2008 4:24 am
Location: Southern California

Post by Susan Smith »

I got similar results as you George, when trying Steve's suggestion of using ENV$("SESSIONNAME").

I got "Console" when local, and "RDP-Tcp#9397" when connected over Terminal Services. This is a great hint, Steve.

-- Susan
Gabriel
Posts: 412
Joined: Sun Aug 10, 2008 7:37 am
Location: Arlington, TX
Contact:

Post by Gabriel »

I have a function that I use to determine connection speed in my BR programs, and I use it to disable graphics when someone is connected remotely. I use it to test when someone is connected via Client Server over the internet, as opposed to connected via Client Server over the LAN. But because it tests the speed of the connection, it could probably be tweaked to test Remote Desktop connections as well.

Basically I print a blank space to window 0 when BR first launches, and I time how long it takes to preform this print operation. If its less then a 20th of a second (less then .05 of a second), then we assume a fast connection. If it takes longer then that, then we assume a slow connection.

Running on a LAN, print fields generally takes around 1/100th of a second. Running over the internet, it takes around 1/5th of a second or longer.

Not sure how it would play out on terminal services, but it may be useful to someone facing a similar problem down the line so i'm posting it here.
GomezL
Posts: 258
Joined: Wed Apr 29, 2009 5:51 am
Contact:

Post by GomezL »

Silly question, how do you measure less than 1 second?
GomezL
Posts: 258
Joined: Wed Apr 29, 2009 5:51 am
Contact:

Post by GomezL »

Just for fun I decided to fire up my Virtual Windows XP window inside windows 7.
SESSIONNAME=RDP-Tcp#14

I think that your idea of using session name is a good default, just setup another environment variable that "overides" the setting.
Gabriel
Posts: 412
Joined: Sun Aug 10, 2008 7:37 am
Location: Arlington, TX
Contact:

Post by Gabriel »

The TIMER system function measures time that claims to be accurate to four decimal places. I'm pretty sure it shows the number of seconds that have lapsed since the computer was turned on or something.

The code I use is this:

Code: Select all

00150     LET STARTTIME=TIMER
00160     PRINT #0, FIELDS "1,1,C 20" : "                    "
00170     LET TOTALTIME=TIMER-STARTTIME
00180     IF TOTALTIME>.05 THEN ! slow connection
00190        LIBRARY "menu" : FNMENU
00200        LET FNMENU ! Run Fast Rinput Select based menu
00210        EXECUTE "system"
00220     ELSE ! normal connection
00230        LIBRARY "screenio" : FNFM
00240        LET FNFM("menu") ! Run slow graphical menu
00250        EXECUTE "system"
00260     END IF
Post Reply