Added in more tests for the NioConnection (to test the context)
Changed from mocking the socket to using a real empty one