Beispiel #1
0
 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();
 }
Beispiel #2
0
        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();
        }