111,046
社区成员
发帖
与我相关
我的任务
分享
public class RequestHandler
{
TcpClient client = new TcpClient();
NetworkStream nStream = client.GetStream();
public RequestHandler(TcpClient client)
{
if (client == null)
{
throw new ArgumentNullException();
}
this.client = client;
client = new TcpClient();
client.Connect("192.168.16.253", 8080); // 与服务器连接
是这样吗 我把 nStrea这样定义成全局?public RequestHandler(TcpClient client)
{
if(client==null)
{
throw new ArgumentNullException();
}
this.client = client;
//your code
}
举例说明