public override void Connect(EndPoint endPoint) { if (null == stubBuilder) { throw new InvalidOperationException("This StubConnection does not support new connections"); } if (IsConnected) { throw new InvalidOperationException("This connection is already connected"); } stub = stubBuilder.Build(endPoint); RunReader(); }
public void Connect(EndPoint remoteEndPoint) { if (IsConnected) { Close(); } stub = connectionBuilder.Build(remoteEndPoint); int rx; var firstMessage = stub.ReadNext(out rx); OnMessageRead(rx); clientId = firstMessage.ClientId; StartReader(); }