代码分2块,server端:
private static void ProcessTcpClient(object state)
{
TcpClient client=state as TcpClient;
if(client==null)
Console.WriteLine("client is null");
NetworkStream ns=client.GetStream();
StreamWriter sw = new StreamWriter(ns);
sw.WriteLine("Welcome.");
sw.Flush();
sw.Close();
client.Close();
}
client端:
新闻热点
疑难解答