本文介绍了如何收听RDP套接字3389?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在尝试使用Tcplistner类监听端口号3389,如下所示.


Hi everyone,

i am trying to listen port number 3389 using Tcplistner class as follow.


......
......
 static void Main(string[] args)
        {
            // port number 3389 reserved as RDP listener port.
            // 3389 port for listening rdp connection request.
            TcpListener tcpListener = new TcpListener(3389);
            tcpListener.Start(); // here i got exception
            Socket socketForClient = tcpListener.AcceptSocket();
..................
.................




在tcpListener.Start();
我有个例外,说


"Only one usage of each socket address (protocol/network address/port) is normally permitted"

怎么出来的呢?

谢谢大家.




at tcpListener.Start();
i got exception saying


"Only one usage of each socket address (protocol/network address/port) is normally permitted"

how to come out of this?

Thanks all.

推荐答案

using System.Net.NetworkInformation;
...
var RdpConnections = IPGlobalProperties.GetIPGlobalProperties().GetActiveTcpConnections().Where(c => c.LocalEndPoint.Port == 3389);



定期调用此按钮以获取新的连接.
遍历RdpConnections并查看其RemoteEndPoint以获取地址.



Call this periodically to get new connections.
Loop through RdpConnections and look at their RemoteEndPoint for address.


这篇关于如何收听RDP套接字3389?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 12:02