Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. Parsing binary TCP messages

Parsing binary TCP messages

Scheduled Pinned Locked Moved WPF
json
8 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    earlgraham
    wrote on last edited by
    #1

    I'm new to silverlight. My web application "Might" attach to a TCP port that outputs a binary compressed TCP message for my web data. I'm trying to decide if I should 1)parse it in silverlight or 2)write a middle-ware application that unpacks it and then sends it to my silverlight App. Thanks for any recommendations.

    Programmer Glenn Earl Graham Austin, TX

    M 1 Reply Last reply
    0
    • E earlgraham

      I'm new to silverlight. My web application "Might" attach to a TCP port that outputs a binary compressed TCP message for my web data. I'm trying to decide if I should 1)parse it in silverlight or 2)write a middle-ware application that unpacks it and then sends it to my silverlight App. Thanks for any recommendations.

      Programmer Glenn Earl Graham Austin, TX

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      earlgraham wrote:

      My web application "Might" attach to a TCP port

      What kind of "web application"? For example, ASP.NET: Silverlight apps run on the client, ASP.NET code runs on the server, so how you implement this depends at least in part on where the code will be running.

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      E 1 Reply Last reply
      0
      • M Mark Salsbery

        earlgraham wrote:

        My web application "Might" attach to a TCP port

        What kind of "web application"? For example, ASP.NET: Silverlight apps run on the client, ASP.NET code runs on the server, so how you implement this depends at least in part on where the code will be running.

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        E Offline
        E Offline
        earlgraham
        wrote on last edited by
        #3

        Code is running on a client webpage. It streams data to a web user for live updates.

        Programmer Glenn Earl Graham Austin, TX

        M 1 Reply Last reply
        0
        • E earlgraham

          Code is running on a client webpage. It streams data to a web user for live updates.

          Programmer Glenn Earl Graham Austin, TX

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #4

          earlgraham wrote:

          Code is running on a client webpage. It streams data to a web user

          So this code is in the Silverlight application then? In that case, doing everything in Silverlight seems the most logical. I'm curious how you are able to provide a listener socket in an application running in a browser...

          Mark Salsbery Microsoft MVP - Visual C++ :java:

          E 1 Reply Last reply
          0
          • M Mark Salsbery

            earlgraham wrote:

            Code is running on a client webpage. It streams data to a web user

            So this code is in the Silverlight application then? In that case, doing everything in Silverlight seems the most logical. I'm curious how you are able to provide a listener socket in an application running in a browser...

            Mark Salsbery Microsoft MVP - Visual C++ :java:

            E Offline
            E Offline
            earlgraham
            wrote on last edited by
            #5

            There is much I don't know about silverlight but there seem to be support for TCP connectivity in silverlight. Here is a good post on it. http://weblogs.asp.net/mschwarz/archive/2008/03/07/silverlight-2-and-sockets.aspx[^] My only concern is working through a binary message byte by byte to convert it into my managed code. I know there are several libraries that are not supported by Silverlight, and I hope that I don't get stuck.

            Programmer Glenn Earl Graham Austin, TX

            M 1 Reply Last reply
            0
            • E earlgraham

              There is much I don't know about silverlight but there seem to be support for TCP connectivity in silverlight. Here is a good post on it. http://weblogs.asp.net/mschwarz/archive/2008/03/07/silverlight-2-and-sockets.aspx[^] My only concern is working through a binary message byte by byte to convert it into my managed code. I know there are several libraries that are not supported by Silverlight, and I hope that I don't get stuck.

              Programmer Glenn Earl Graham Austin, TX

              M Offline
              M Offline
              Mark Salsbery
              wrote on last edited by
              #6

              earlgraham wrote:

              there seem to be support for TCP connectivity in silverlight

              Connecting, yes, but listening for connections?

              earlgraham wrote:

              working through a binary message byte by byte to convert it into my managed code

              The BitConverter class is handy for that. For strings, the Encoding class can help. Of course, if you're unable to parse and/or decompress the data from Silverlight code with its limited .NET framework, then you will probably want to consider serializing the data in a format more Silverlight-friendly.

              Mark Salsbery Microsoft MVP - Visual C++ :java:

              E 1 Reply Last reply
              0
              • M Mark Salsbery

                earlgraham wrote:

                there seem to be support for TCP connectivity in silverlight

                Connecting, yes, but listening for connections?

                earlgraham wrote:

                working through a binary message byte by byte to convert it into my managed code

                The BitConverter class is handy for that. For strings, the Encoding class can help. Of course, if you're unable to parse and/or decompress the data from Silverlight code with its limited .NET framework, then you will probably want to consider serializing the data in a format more Silverlight-friendly.

                Mark Salsbery Microsoft MVP - Visual C++ :java:

                E Offline
                E Offline
                earlgraham
                wrote on last edited by
                #7

                It will not be listening. Only requesting data from a server that hosts the data. Sorry I miss understood. Yeah its a tough decision, there are several options for me. 1) I can edit the data server, but its an established C++(unmanaged) application. I will have several of the senior programmers grilling me on whether I screwed up anything. 2) I could write an app that uses a different port. Then all my silverlight traffic goes to that port. I convert the data and forward. (this is my preferred approach) 3) OR Convert in the silverlight app. What fun!!!

                Programmer Glenn Earl Graham Austin, TX

                M 1 Reply Last reply
                0
                • E earlgraham

                  It will not be listening. Only requesting data from a server that hosts the data. Sorry I miss understood. Yeah its a tough decision, there are several options for me. 1) I can edit the data server, but its an established C++(unmanaged) application. I will have several of the senior programmers grilling me on whether I screwed up anything. 2) I could write an app that uses a different port. Then all my silverlight traffic goes to that port. I convert the data and forward. (this is my preferred approach) 3) OR Convert in the silverlight app. What fun!!!

                  Programmer Glenn Earl Graham Austin, TX

                  M Offline
                  M Offline
                  Mark Salsbery
                  wrote on last edited by
                  #8

                  I suppose option 2 is the most flexible, since you can re-shape the data and use any transfer/serialization mechanism available to Silverlight apps. Have fun! :)

                  Mark Salsbery Microsoft MVP - Visual C++ :java:

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups