有谁知道一个非常好的 Windows 客户端/服务器 tcp/udp 终端实用程序?

发布于 2024-09-02 09:47:48 字数 98 浏览 3 评论 0原文

我想要一个实用程序,允许我作为客户端或服务器发送/接收 tcp 和 udp 消息、组装数据包、设置响应等......最好在 Windows 上。如果您见过类似的事情,请告诉我。谢谢!

I would like a utility that would allow me to send/receive tcp and udp messages as a client or server, assemble packets, set responses, etc... Preferably on Windows. Please let me know if you've seen anything like this. THANKS!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

薄荷港 2024-09-09 09:47:48

为此,我使用“Hercules SETUP Utility”。乍一看似乎太简单了,但它确实是非常有用的实用程序。

I use "Hercules SETUP Utility" for this. It looks too simple at first blush, but it is the the very useful utility indeed.

无敌元气妹 2024-09-09 09:47:48

为什么不尝试使用一种 .NET 语言在 System.Net 中使用 TcpClient 和 TcpListener?使用这些类来实现您自己的客户端/服务器系统非常简单。

Why don't you try the TcpClient and TcpListener in System.Net in one of the .NET languages? It is very simple to use these classes to implement a client/server system for your own.

两相知 2024-09-09 09:47:48

您可以使用 Docklight 脚本

  • 向 TCP 服务器发送/接收 ASCII 或二进制消息。
  • 成为 TCP 服务器并接受一个传入连接,然后再次能够接收和发送 TCP 消息。包括发送对传入数据的自动应答/反应。
  • 充当 UDP 对等方并发送/接收 UDP 消息。

我自己没有尝试过的另一个免费软件解决方案是 Packet Sender

You can do the following with the free evaluation version (no time limit) of Docklight Scripting on Windows:

  • Send/receive ASCII or binary messages to/from a TCP server.
  • Be a TCP server and accept one incoming connection, then again being able to receive and send TCP messages. Including sending out automatic answers / reactions to incoming data.
  • Act as a UDP peer and send/receive UDP messages.

Another freeware solution that I didn't try myself, but looks really good is Packet Sender

甜味超标? 2024-09-09 09:47:48

尝试使用 YAT 终端。它可以处理 TCP/UDP/串行通信。使用热键和按钮发送宏的良好设置

Try to use YAT Terminal. It could process TCP/UDP/Serial communication. Nice setup for macros to send with hotkeys and buttons

放手` 2024-09-09 09:47:48
//Server Binding

IPHostEntry ipHostInfo = Dns.Resolve(Dns.GetHostName());
IPAddress ipAddress = ipHostInfo.AddressList[0];
serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
IPEndPoint ipEndPoint = new IPEndPoint(ipAddress, 2015);
serverSocket.Bind(ipEndPoint);

//Begin Recceive from any client
IPEndPoint ipeSender = new IPEndPoint(IPAddress.Any, 0);
EndPoint epSender = (EndPoint)ipeSender;
serverSocket.BeginReceiveFrom(byteData, 0, byteData.Length, SocketFlags.None, ref epSender, new AsyncCallback(OnNetworkBytesReceived), epSender);


private void OnNetworkBytesReceived(IAsyncResult ar)
{
   IPEndPoint ipeSender = new IPEndPoint(IPAddress.Any, 0);
   EndPoint epSender = (EndPoint)ipeSender;
   int BytesRead = serverSocket.EndReceiveFrom(ar, ref epSender);
   //parse your data
   ParseNetworkBytes(BytesRead, epSender);
   serverSocket.BeginReceiveFrom(byteData, 0, byteData.Length, SocketFlags.None, ref    epSender, new AsyncCallback(OnNetworkBytesReceived), epSender);

}//OnNetworkBytesReceived()

//for sending to client
Byte[] byteDataTemp = msg.messagePacketByLength(i, Constants.MAXSENDBUFFERSIZE);
serverSocket.BeginSendTo(byteDataTemp, 0, byteDataTemp.Length, SocketFlags.None, epRcvr, new AsyncCallback(OnSend), null);


private void OnSend(IAsyncResult ar)
{ 
    try
    { 
        lock (serverSocket)
        { 
            serverSocket.EndSendTo(ar);
        } 
    } 
    catch (ObjectDisposedException objexp)
    { 

    } 
    catch (Exception exp)
    { 

    } 
}//OnSend()
//Server Binding

IPHostEntry ipHostInfo = Dns.Resolve(Dns.GetHostName());
IPAddress ipAddress = ipHostInfo.AddressList[0];
serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
IPEndPoint ipEndPoint = new IPEndPoint(ipAddress, 2015);
serverSocket.Bind(ipEndPoint);

//Begin Recceive from any client
IPEndPoint ipeSender = new IPEndPoint(IPAddress.Any, 0);
EndPoint epSender = (EndPoint)ipeSender;
serverSocket.BeginReceiveFrom(byteData, 0, byteData.Length, SocketFlags.None, ref epSender, new AsyncCallback(OnNetworkBytesReceived), epSender);


private void OnNetworkBytesReceived(IAsyncResult ar)
{
   IPEndPoint ipeSender = new IPEndPoint(IPAddress.Any, 0);
   EndPoint epSender = (EndPoint)ipeSender;
   int BytesRead = serverSocket.EndReceiveFrom(ar, ref epSender);
   //parse your data
   ParseNetworkBytes(BytesRead, epSender);
   serverSocket.BeginReceiveFrom(byteData, 0, byteData.Length, SocketFlags.None, ref    epSender, new AsyncCallback(OnNetworkBytesReceived), epSender);

}//OnNetworkBytesReceived()

//for sending to client
Byte[] byteDataTemp = msg.messagePacketByLength(i, Constants.MAXSENDBUFFERSIZE);
serverSocket.BeginSendTo(byteDataTemp, 0, byteDataTemp.Length, SocketFlags.None, epRcvr, new AsyncCallback(OnSend), null);


private void OnSend(IAsyncResult ar)
{ 
    try
    { 
        lock (serverSocket)
        { 
            serverSocket.EndSendTo(ar);
        } 
    } 
    catch (ObjectDisposedException objexp)
    { 

    } 
    catch (Exception exp)
    { 

    } 
}//OnSend()
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文