added a server side gate for attempting a set
refactoring
Merge pull request #2 from willtsay/socketbugs

Socketbugs