Initializes a connection loop.
This function is NOT Thread Safe, so it must be called in synchronous environment