send header and message together to avoid errors when sending two messages immediately
Merge pull request #5 from dyfer/master

send header and message together