Shared networking code between MSEAPI-CS (client) and MSEAPI (server)