Make it possible to set the send and receive buffers.

Add a default of 64kb overridable with the config file.
Prevent excess looping in the socket code.

If disconnect is called, this may be from one of the callbacks, and the
previous change here would make us try and loop and try again, if we are
disconnecting dont' do that..