Exemplo n.º 1
0
 /// <summary>
 /// ソケット接続
 /// </summary>
 /// <param name="cb"></param>
 /// <param name="address"></param>
 /// <param name="port"></param>
 public Sock(ToCallback cb, string address, int port)
 {
     _cb = cb;
     // try to connect
     this.connection.Connect(address, port);
     //if successful
     if (this.connection.Connected)
     {
         // NetworkStreamを取得する
         ns = connection.GetStream();
         // 受信開始
         connection.Client.BeginReceive(
             this.buffer,
             0,
             this.buffer.Length,
             SocketFlags.None,
             new AsyncCallback(this.handleServerMessage),
             null);
     }
 }
Exemplo n.º 2
0
 public Lens(FromCallback from, ToCallback to)
 {
     From = from;
     To   = to;
 }