Make the Protosockets examples possible to compile.

Issue #774 reports that the Protosockets examples contain errors. This pull request makes some corrections of those files in order to make them compile cleanly.