You calculate size incorrect. 
```
sizeof( static_cast< boost::uint32_t > ( strlen( mess.msg() ) + 1 ) ) )
```
it's always == 4. sizeof must be of type, not of number