Add blocking flush
Use send rather than write