Fixed example code to use close()
This commit is contained in:
parent
b52c80b600
commit
c9dd7a5a7c
|
|
@ -65,7 +65,7 @@ Here is a simple example: Connect to a router and reboot it.
|
||||||
ApiConnection con = ApiConnection.connect("10.0.1.1"); // connect to router
|
ApiConnection con = ApiConnection.connect("10.0.1.1"); // connect to router
|
||||||
con.login("admin","password"); // log in to router
|
con.login("admin","password"); // log in to router
|
||||||
con.execute("/system/reboot"); // execute a command
|
con.execute("/system/reboot"); // execute a command
|
||||||
con.disconnect(); // disconnect from router
|
con.close(); // disconnect from router
|
||||||
```
|
```
|
||||||
The above example shows a easy way of creating an unencrypted connection using the default API port and timeout, which is useful for development and testing.
|
The above example shows a easy way of creating an unencrypted connection using the default API port and timeout, which is useful for development and testing.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue