SharpPcap and NetworkStream for capturing tcp packets data c#

431 Views Asked by At

I have written multiple client server where my client will be some monitoring machine which will sending tcp packets with some data packets. My server code uses NetworkStream to receive data from client. My question is that if it is possible to capture NetworkStream data using SharpPcap and dump it to file which can be analysed by my own packet parser. How should I start if it is possible? My server code is following

Socket socketforClient = tcpListener.AcceptSocket();
NetworkStream networkStream = new NetworkStream(socketForClient);
0

There are 0 best solutions below