Check socket types during mechanism handshake
Merge pull request #602 from hurtonm/master

Implement socket type checking