开发者

How to get socket ID/handle/descriptor for an already open connection? (.NET,C++,Delphi)

开发者 https://www.devze.com 2022-12-28 12:29 出处:网络
my question is stated in the title. How exactly do I do that? I have an open connection and I want to \"hijack\" it and send my custom messages through it. From my understanding that is done with so

my question is stated in the title. How exactly do I do that?

I have an open connection and I want to "hijack" it and send my custom messages through it. From my understanding that is done with sockets and their handlers.

Any language would do but C#.NET is preferred.

Thank you

UPDATE: What exactly am I trying to achieve: I want to implement a keep-alive system for postgresql clients. That means get all 开发者_如何学编程the connections open to a postgresql database and every 5 minutes querying the database "select version()" to keep the connection alive. That's about it. It's for educational purposes mostly.

But I want to use this for any kind of connection.

Anyone? Ideas? Nothing? :(


This library: SharpPcap promises doing capturing, injecting, analyzing and building packets using any .NET language such as C# and VB.NET (more info)

It is the library used by Wireshark and it is for sure that it can capture and analyze.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号