The Server class controls the behaviour and the configuration of the FTP and telnet services running on the SG device. Any changes performed using this class’ methods will affect both.
Server
Example:
import network server = network.Server() server.deinit() # disable the server # enable the server again with new settings server.init(login=('user', 'password'), timeout=600)
from network import Server # init with new user, password and seconds timeout server = Server(login=('user', 'password'), timeout=60) server.timeout(300) # change the timeout server.timeout() # get the timeout server.isrunning() # check whether the server is running or not
Create a server instance, see init for parameters of initialisation.
init
Init (and effectively start the server). Optionally a new user, password and timeout (in seconds) can be passed.
user
password
timeout
Stop the server.
Get or set the server timeout.
Returns True if the server is running (connected or accepting connections), False otherwise.
True
False