Factory for IConnection to avoid strange bug with delegates. Debuged
connection handling logic.