added emit connection event
added test for connection event, moved ring buffer unit tests to separate file