Reputation: 175
I am writing application that is using UdpClient to send and receive data, but i am getting many data sent wrong. I need to figure out how my data is transfered between client and server. So i need some sniffer plugin for Visual Studio cause i don't want to use some heavy tools like WireShark. So is it possible to track received and transmitted data in my application?
Upvotes: 1
Views: 2418
Reputation: 115037
You can use the "Network Tracing" feature built into .NET itself.
<configuration>
<system.diagnostics>
<sources>
<source name="System.Net" tracemode="includehex" maxdatasize="1024">
<listeners>
<add name="System.Net"/>
</listeners>
</source>
<source name="System.Net.Sockets">
<listeners>
<add name="System.Net"/>
</listeners>
</source>
</sources>
<switches>
<add name="System.Net" value="Verbose"/>
<add name="System.Net.Sockets" value="Verbose"/>
</switches>
<sharedListeners>
<add name="System.Net"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="network.log"
/>
</sharedListeners>
<trace autoflush="true"/>
</system.diagnostics>
</configuration>
Upvotes: 3