Decoding data from a TCP/IP Packet
Hello,
There is a server application which keeps on writing some data into a tcp/ip port (514). I am trying to write a windows application which captures this data, do some manipulations and saves into a database. My idea was to write a simple socket listener (socket server) which listens to this port, but that is not capturing any data from this port. Any ideas on what kind of application I should write here? And please share if you have any samples....
Thanks
Sree
Re: Decoding data from a TCP/IP Packet
A listening socket will wait for incoming connections and accept them, not monitor the datastream on a particular socket. For that you'll need to use a tool like Wireshark (or others).
This article may or not be useful for doing some custom processing: http://www.codeproject.com/KB/IP/custom_dissector.aspx
Re: Decoding data from a TCP/IP Packet
If you need to do the capture in code, you should look at the WinPCAP library and its C# wrapper, PCAP.NET.
(p.s. HighCommander4 is sad because he liked his post count being 1337 :D).
Re: Decoding data from a TCP/IP Packet
Good call, Commander. I didn't know about the .NET wrapper around WinPCap; that's useful.