breve Documentation: version 1.9 | ||
---|---|---|
<< previous | next >> |
breve supports two kinds of networking: sending objects over the network from one simulation to another, and interacting with running breve simulations using a web browser.
This chapter starts by describing how to create a NetworkServer object which is used for both of these networking features (Section 10.1). Next, sending and receiving breve objects over the network is described (Section 10.2). The final section describes how to allow the control of a breve simulation via a web interface (Section 10.3).
To start a network server, make a new instance of the class NetworkServer. The NetworkServer class is used for both receiving object from other breve simulations, and for allowing a web interface to your breve simulation.
Once the NetworkServer instance has been created, it should be told to start listening for connections using the method listen. The listen method expects a port number which must be greater than 1024, but otherwise may be any unused port that both the client and the server breve users can agree to.
<< previous | breve Documentation table of contents | next >> |
Saving and Loading the Entire State of a Simulation | Sending and Receiving breve Objects |