Dart Telnet Control
Rlogin Method
Can be either a host name (host.dart.com) or dot address (nnn.nnn.nnn.nnn).
Login name of the user on the client host.
Login name of the user on the server. Defaults to User if unspecified.
Terminal type and speed. Defaults to vt320/19200 if unspecified. Separate the terminal type from speed using the / as shown.
Number of character rows. Defaults to 24.
Number of characters per row. Defaults to 72.
Number of pixels for the client window in the X direction. Defaults to 640.
Number of pixels for the client window in the X direction. Defaults to 480.
Must be a value between 1 and 65535, inclusive. Defaults to 513.
Local interface to bind socket to.
Local port to bind socket to.
Description
Uses the remote login protocol common to UNIX systems, which is similar to Telnet but simpler. It does not require Telnet option negotiation because it was intended for use between two UNIX systems.
Syntax
Visual Basic
Public Sub Rlogin( _
   ByVal RemoteName As String, _
   ByVal User As String, _
   Optional ByVal ServerUser As String, _
   Optional ByVal TermTypeSpeed As String, _
   Optional ByVal CharRows As Long = 0, _
   Optional ByVal CharsPerRow As Long = 0, _
   Optional ByVal PixelsX As Long = 0, _
   Optional ByVal PixelsY As Long = 0, _
   Optional ByVal RemotePort As Long = 0, _
   Optional ByVal LocalName As String, _
   Optional ByVal LocalPort As Long = 0 _
) 
Parameters
RemoteName
Can be either a host name (host.dart.com) or dot address (nnn.nnn.nnn.nnn).
User
Login name of the user on the client host.
ServerUser
Login name of the user on the server. Defaults to User if unspecified.
TermTypeSpeed
Terminal type and speed. Defaults to vt320/19200 if unspecified. Separate the terminal type from speed using the / as shown.
CharRows
Number of character rows. Defaults to 24.
CharsPerRow
Number of characters per row. Defaults to 72.
PixelsX
Number of pixels for the client window in the X direction. Defaults to 640.
PixelsY
Number of pixels for the client window in the X direction. Defaults to 480.
RemotePort
Must be a value between 1 and 65535, inclusive. Defaults to 513.
LocalName
Local interface to bind socket to.
LocalPort
Local port to bind socket to.
Remarks

The remote login protocol supports the concept of window size, where the server requests the window size of the client. Responses are automatic using the parameter values from the CharRows, CharsPerRow, PixelsX, and PixelsY parameters. See RFC 1282 for the complete remote login protocol description.

This method requires authorization for the local host running your application. This is done by adding the proper entries to the hosts.equiv or .rhosts files located on the remote host. These files enable logins to be performed from other machines and users. The hosts.equiv file is a system file containing names of remote hosts authorized to execute the remote protocol. If not authorized in this file, the remote host looks for the .rhosts file located in the user's account on the remote host. The .rhosts file contains lines of host names and login names paired together. Your local host with login name is authorized if found in this file.

When this method is called a connection is initiated with the remote host using the remote login protocol. The State property immediately changes to tcpConnecting and then changes to tcpConnected when the connection is established. The State Property can be checked in the body of the State event, polled off a timer, or checked immediately after the method is invoked when a positive Timeout is specified. The remote host prompts for the password if a password exists for the user. Rlogin is normally used as a Telnet replacement for an interactive session. Use the Rexec or Rsh method if you simply want to execute a remote command.

This method is invoked as blocking or non-blocking, depending on the value of the Timeout property.

When performing blocked method calls, the Blocked property may be checked to verify the control is not busy executing another method.

Error Codes
The Rlogin method may generate the following error codes (refer to the ErrorConstants topic for a complete list of Telnet Control error codes):

 

Example
Private Sub Command1_Click()
On Error GoTo OnError ' use intrinsic error handling
	Telnet1.Timeout = 1000
	Telnet1.Rlogin "myhost", "myUsername"
	' didn't go to OnError, so we connected before 30 seconds elapsed!
	MsgBox "Connected!"
	Dim Output As String
	Telnet1.Receive Output
	Text1.Text = Output
	Exit Sub
OnError: ' Any error jumps here
	' no connection within 1 second, or other error (Tcp1.State is tcpClosed)
	Debug.Print "Error #" + CStr(Err.Number) + ": " + Err.Description
End Sub
Private Sub Command1_Click()
	' intrinsic error handling is of limited value for asynchronous connection&ldots;
	Telnet1.Timeout = 0
	Telnet1.Rlogin "myhost", "myUsername"
End Sub
 
Private Sub Telnet1_State()
	If Telnet1.State = tcpConnected Then MsgBox "Connected!"
End Sub
 
Private Sub Telnet1_Receive()
	Dim Output As String
	Telnet1.Receive Output
	Text1.Text = Output
End Sub
See Also

Telnet Object  | Telnet Members


Documentation Version 1.9.3.0
© 2020 Dart Communications. All Rights Reserved.
Send comments on this topic