Fixed typo in method name
Restructured code to better support sending multiple messages in a single socket packet