Tcp 监听器变量重用!!C# [英] Tcp Listner Variable reuse!! C#

查看:44
本文介绍了Tcp 监听器变量重用!!C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 Tcp 监听器TcpListner 监听器它正在运行我想阻止它然后在另一个IP上使用它我怎样才能做到这一点?我不想创建新的 TcpListner 变量 (C#)

I have a Tcp Listner TcpListner Listner it is running I want to stop it and then use it on another IP how can I do that? I don't want to create new TcpListner variable (C#)

推荐答案

端点在构造函数中指定,因此:您将需要第二个 TcpListener 对象.那是不可避免的.您可以重用存储对象引用的变量,但我不确定这就是您的意思(我很确定您要问的是对象,而不是变量).

The endpoint is specified in the constructor, so: you will need a second TcpListener object. That is unavoidable. You can reuse the variable that you store the object reference in, but I'm not sure that this is what you mean (I'm pretty sure you're asking about the object, not the variable).

这篇关于Tcp 监听器变量重用!!C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆