added stronger assertions to the stream-typed cosocket implementation.