|
C#聊天程序(15) SetStatus(Status.Connected); NetworkStream stream = new NetworkStream(socket); reader = new StreamReader(stream); writer = new StreamWriter(stream); Notifications(Notification.Initialized, this); }else{ Notifications(Notification.Error, "Failed to Establish Socket"); } // Start receiving talk // Note: on w2k and later platforms, the NetworkStream.Read() // method called in ReceiveTalk will generate an exception when // the remote connection closes. We handle this case in our // catch block below. ReceiveTalk(); // On Win9x platforms, NetworkStream.Read() returns 0 when
|