socket是引型吧,可为什么两个socket的Connected会不一样?
poetc 2003-04-17 10:12:29 主窗体form1 socket;
在子窗体构造函数中将form1中socket传进来:
构造函数:
public Form2(Form1 form1)
{
this.form1=form1;
this.socket=form1.socket;
}
当我form1中socket连接上后,
bool b1=this.form1.socket.Connected;
bool b2=this.socket.Connected;
//b1=true;b2=false;
why???