Parsing binary TCP messages
-
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
-
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
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:
-
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:
Code is running on a client webpage. It streams data to a web user for live updates.
Programmer Glenn Earl Graham Austin, TX
-
Code is running on a client webpage. It streams data to a web user for live updates.
Programmer Glenn Earl Graham Austin, TX
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:
-
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:
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
-
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
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:
-
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:
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
-
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
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: