Connectionmanager: Bugfix.
Connection: Writing is now done in separate thread to prevent locks.