views:

246

answers:

1

Hello all,

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? :(

+1  A: 

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.

Cristian
Thank you very much for the answer. Will give it a go :D
AlexRednic