/// <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); } }
public Lens(FromCallback from, ToCallback to) { From = from; To = to; }