Thanks for pointing the alternatives.
Interesting point (having the change in handle_cast(out_socket=undefined)). When thought about this, I was thinking that we could be in connected state with a non empty queue (C++ mindset :(. With gen_server, don't have to think about concurrency, We wouldn't be processing a message when connection is there and queue is non empty! 
The other thing that I was deciding on is if I should do the send on all buffers in a tight loop or just post message after consuming 1 to drain the next one. That would allow for the gen_server to consume any other type of messages which led me down this path. I'll leave it as is mostly for now with type changed to boolean as it affords more flexibility in tweaking this behavior.