Decoding data from a TCP/IP Packet
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Decoding data from a TCP/IP Packet

  1. #1
    Join Date
    Jun 2011
    Posts
    1

    Question 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

  2. #2
    Join Date
    Feb 2011
    Location
    United States
    Posts
    1,006

    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
    Best Regards,

    BioPhysEngr
    http://blog.biophysengr.net
    --
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

  3. #3
    Join Date
    Apr 2004
    Location
    Canada
    Posts
    1,342

    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 ).
    Last edited by HighCommander4; June 22nd, 2011 at 01:24 AM.
    Old Unix programmers never die, they just mv to /dev/null

  4. #4
    Join Date
    Feb 2011
    Location
    United States
    Posts
    1,006

    Re: Decoding data from a TCP/IP Packet

    Good call, Commander. I didn't know about the .NET wrapper around WinPCap; that's useful.
    Best Regards,

    BioPhysEngr
    http://blog.biophysengr.net
    --
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center