Merged socketMock from demo branch