private void suckit()      //线程同步方法
{
IPAddress theIP = IPAddress.Parse("127.0.0.1");
IPEndPoint theServer = new IPEndPoint(theIP,8888);
theSock = new Socket(AddressFamily.InterNetwork,SocketType.Stream,ProtocolType.Tcp); theSock.Bind(theServer);
theSock.Listen(50);
show1.Text = "Listenning port......";
accsock = theSock.Accept();
if(accsock.Connected)
{

Byte[] sendStr = new Byte[512];
NetworkStream nS = new NetworkStream(accsock);
nS.Read(sendStr,0,sendStr.Length);
string Str = System.Text.Encoding.BigEndianUnicode.GetString(sendStr);
MessageBox.Show(Str);
}private void send()                   //发送数据代码
{
try
{

Byte[] sendStr = new Byte[512];
string Str = "xxxx";
NetworkStream nS = new NetworkStream(accsock);
sendStr = System.Text.Encoding.BigEndianUnicode.GetBytes(Str.ToCharArray());
nS.Write(sendStr,0,sendStr.Length);
f.Text = "sent";
}
catch(Exception ex)
{
f.Text = ex.ToString();
}
}当连接成功后,执行send方法发送数据流,可程序什么也接收不到,也就是说nS.Read(sendStr,0,sendStr.Length);下面的代码不会执行,请问这是为什么?谢谢!