Change queues to deques.

queues are very useless in this context.
Implement disconnect().
Implement shutdown().
Set receive buffer sizes.