set websocket payload as binary and change websocket subprotocol
Ability to set write deadline, and bugfixes

If the connection is dropped and a message is in the process of being published, it will block and
prevent the ping handling from realizing that the connection has been lost. By allowing the user
to set a write deadline, they specify the max time we should block until we error on the publish
with a timeout.

Signed-off-by: Christie Deiters <cdeiters@lutron.com>
Closing the connection if client.Start returns an error.

If during Start the connection is made, but an error is encountered later and start returns an error,
we should be closing the connection before returning to prevent leaking file descriptors.

Change-Id: Ibc68677768e4bf3d9694a588316affde2e36517b
Signed-off-by: Christie Deiters <cdeiters@lutron.com>
Rather than having SetBroker and SetStandbyBroker for HA/clustered setups there is instead just AddBroker. The client now stores a slice of URLs and will iterate through all of them when trying to connect.
fix for bug 439667 - Incorrect mutex locking order in router.go

Signed-off-by: Bill Hathaway <bill.hathaway@gmail.com>
Simplify trace mechanism, remove multiple pub channels as it breaks ordering, update samples, default is no logging information.
Bugfix: c.stop closed twice in some startup conditions.

Sometimes net.connect sees an issue and pushes an error on c.errors before returning an rc of CONN_FAILURE. It is also possible
to exit net.connect with a non-successful rc but NOT get an error on c.errors. So I updated net.connect to not push errors on
c.errors, but instead just return CONN_FAILURE and allow client.Start to put the erorr on the channel. In addition, I made c.errors
a buffer size 1 and updated all pushes to that channel to be a select with an empty default. This allows us to use c.errors as a flag channel so that
the first error can always get through, but subsequent attempts to push errors will not block forever.

Also, the begin chan ConnRC in MqttClient was not longer being initialized so I removed it. I also removed the call to close it in net.connect, since
closing a nil channel was causing a crash.

Change-Id: I0988ad51e7740b03fff832084ea65dcbce173884
Signed-off-by: Christie Deiters <cdeiters@lutron.com>