How to get socket ID/handle/descriptor for an already open connection? (.NET,C++,Delphi)
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.
精彩评论