next | previous | forward | backward | up | top | index | toc | Macaulay2 website
Visualize :: openPort

openPort -- opens a port



In order to use the visualize method, the user must first open a port on their machine. This can be dangerous as someone could potentially be listening on that port. The port being open is only accessible to the localhost and is most vulnerable if the package is being run on a server. If running on a personal computer/laptop, then the risk of cyber attack is very small as the attacker would have to have access to your local machine. Because of this risk, and the fact that the examples will throw errors if the user is using the example port, the documentation will not actually run examples of openPort.

The user can use any port number they wish. Common ports are '8080' and '8081'. For example, openPort"8080" will open port '8080' for communication.

Once a port is open, another instance of openPort will not be allowed to open another port. Hence the user can only open one port at a time with this method. Once finished visualizing, you can close the port with the closePort method.

i1 : closePort()
--Port null is now closing. This could take a few seconds.

Restarting Macaulay2 will also close the port.

See also

Ways to use openPort :

For the programmer

The object openPort is a method function.