|Top Previous Next|
The connection object holds the connection to the remote end being controlled. For example an amplifier. It's created by the transport.new function. It automatically tries to reconnect if the connection has dropped and dishes out data in transaction based packets. The TCP Object, SSL Object and Serial Object subclass this object.
Attempts to establish a connection to the remote end. If successful the connection callback is called on the Connection Object with status parameter "Connected".
Closes the connection to the remote end. If successful ( if not closed already ) the connection callback is called with the status "Disconnected".
Closes and reopens the connection calling the connection callback as appropriate.
When data comes in, Girder can chop it into blocks of data before it reaches your code. For example if you know that all responses are delimited by an endline (\n) you can set up a terminated parser with parameter "\n". Each parser has different options. See the parser type page for the details.
Creates a new transaction object with the callbacks as specified in the call. The signatures of the callback functions are:
Queues the transaction up for sending out. If the connection was not yet established it is simply queued up until the connection is open. If queueFirst is true the transaction is queued at the start of the transaction queue.