Previous Thread
Next Thread
Print Thread
Zterm w/Linux #26865 30 Jan 09 02:58 PM
Joined: Sep 2002
Posts: 5,450
F
Frank Online Content OP
Member
OP Online Content
Member
F
Joined: Sep 2002
Posts: 5,450
Hi,

Im sure there has to be an xcall miamex or something to help out with this but cant seem to find it.

Scenario:

Linux server using Zterm. Some serial some networked. (dont ask!)

I want to be able programatically to detect if the current session is serial or telnet.

Reason: We are using FTP to transfer some files to the local pc for another program bridge, and do not want to do it on serial sessions.

Thanks in advance for any ideas!

Re: Zterm w/Linux #26866 30 Jan 09 03:48 PM
Joined: Jun 2001
Posts: 11,645
J
Jack McGregor Online Content
Member
Online Content
Member
J
Joined: Jun 2001
Posts: 11,645
I suggest XCALL GETUSN,usrnam$,console$

For telnet connections, console$ (aka machine$ per the doc) will be something like:

pts/10:18234

while serial connections will be, well, different. (I don't have a handy serial connection to test.)

You'll need to be flexible on your syntax analysis of the two types, because both types will start with the name of the device, which can vary depending on several factors. In particular, I think "pts" may switch one of its letters when you hit some kind of maximum number of connections. (You might want to log on to your largest system and do a finger to see what the range is.)

Note: the AGF_TNT flag in AUI_ENVIRONMENT, which sounds like it might tell this information, is only useful under Windows for distinguishing between local/file-sharing and telnet(ATSD). (I think I ran into the same problem just described - not knowing a simple conclusive way to distinguish between TCP/serial.)

Re: Zterm w/Linux #26867 30 Jan 09 04:09 PM
Joined: Feb 2002
Posts: 94
T
Tom Jeske Online Content
Member
Online Content
Member
T
Joined: Feb 2002
Posts: 94
ZTerm has an escape sequence you can run programmatically to determine telnet vs serial.

Chech ZTerm help under escape sequences for the details.

Re: Zterm w/Linux #26868 02 Feb 09 10:11 AM
Joined: Sep 2002
Posts: 5,450
F
Frank Online Content OP
Member
OP Online Content
Member
F
Joined: Sep 2002
Posts: 5,450
Thanks Gentlemen... will look at your suggestions!


Moderated by  Jack McGregor, Ty Griffin 

Powered by UBB.threads™ PHP Forum Software 7.7.3