The connect and disconnect actions of the Connection part enable your application to establish and terminate network connections.
Make a connection to the connect action of the Connection part. The connect action requires the spec parameter, which represents the connection spec identifying the remote server and the protocol-specific communication parameters. To supply the connection spec, make a connection from the spec attribute of the connection that triggers the connect action, to the self attribute of the appropriate connection spec.
The connected event of the connection part indicates that the connection was successful.
Make an event-to-action connection to the disconnect action of the Connection part.
The disconnected event indicates that the Connection part has successfully disconnected from the server.