MIAMEX 76: Start telnet server

xcall MIAMEX, MX_TELSER, port, status {,wait}

(Windows only) MX_TELSER allows you to turn your current A-Shell/Windows client into a telnet server for a single remote client. Your session will continue to run normally until a telnet client connects; at that point, your window will be hidden and all terminal I/O redirected to the remote telnet client.

Beginning with A-Shell 1176 of March 2010, passing 0 for the port value now closes/releases any socket resources opened by a prior MX_TELSER call. This allows the operation to be cleaned up and restarted. Also, when the client disconnects, the server job reliably receives error 250. (Previously it may have only gotten a Ctrl+C signal.)

Parameters

port  (Num)

specifies the port number to accept the incoming connection request on.

status  (F,6)

returns a code indicating the success of the operation, from the following table:

Value

Meaning

0

Success

-1

Unable to load Winsock library

-2

Winsock 1.1+ not present

-3

Unable to create listening socket

-4

User abort (Ctrl+C while waiting for connection)

 

Wait  (Num)

may be used to specify options (combine zero or more from the following table):

Value

Meaning

1

Minimize window immediately and wait for connection before returning from subroutine.  (Otherwise it returns immediately with the wait operation waiting in background for the connection.)

2

Launch a new instance to wait for a subsequent connection upon accepting the first connection

4

Make waiting window totally invisible

 

You can restore visibility to an invisible window waiting for a connection by using SEND.LIT or SEND.SBR to send it a message consisting of just an exclamation point (!).

History

2010 March, A-Shell 5.1.1176:  Minimize window immediately and wait for connection before returning from subroutine. (Otherwise it returns immediately with the wait operation waiting in background for the connection.)