Move socket creation to constructor, add isOK() check method.