Click here to Skip to main content
15,904,153 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hey i was wondering if it is possible to compress or pack tcp data between server and client in any way in vb.net I have tested with streams and try to find answers on Google but all the answers that I found are too difficult for me or else than I thought I
so i was wondering if anyone here knows how to compress tcp and decompress data between server and client, and I would gladly appreciate it if any spanked hope someone
understands me question and yes thanks in advance


I translated it with Google translate sorry if it's typo
Posted
Comments
Mehdi Gholam 24-Sep-13 13:00pm    
Are you writing your own tcp protocol (in your vb.net application) and do you control both client and server apps? or do you want to compress any tcp communication?
Sergey Alexandrovich Kryukov 24-Sep-13 13:05pm    
Right. Please see my comment below...
—SA
Sergey Alexandrovich Kryukov 24-Sep-13 13:08pm    
I provided some relevant links, please see my answer.
I also credited your comment. :-)
—SA
Sergey Alexandrovich Kryukov 24-Sep-13 13:05pm    
Just a note: if you are going to compress and decompress the whole TCP traffic, it simply means that you need another protocol, the one on top of TCP. As, formally, the next level belongs to the application layer of the IP protocol suite, you would need to introduce it in the application layer...
—SA
wawada 24-Sep-13 13:16pm    
I meant that I will compress all tcp data I send and receive in between my server application and client application that I made in vb.net

Please see the comments to the question.

This should be helpful:
http://en.wikipedia.org/wiki/TCP_acceleration[^],
http://en.wikipedia.org/wiki/FAST_TCP[^],
http://netlab.caltech.edu/FAST/[^].

You can take some different route: keeping to use "standard TCP", compress the data you write in the networks stream. I cannot see any problem with that. (This is probably what Mehdi Gholam meant in his comment.)

—SA
 
Share this answer
 
v4
Comments
Mehdi Gholam 24-Sep-13 13:26pm    
5'ed

I will probably have to update my WCFKiller article with the new code in RaptorDB which does transfer (bin or json or binaryjson) and compression.
Sergey Alexandrovich Kryukov 24-Sep-13 13:27pm    
Thank you, Mehdi.
You see how helpful could be exchange of ideas, even the simple ones!
—SA
wawada 24-Sep-13 14:47pm    
i do not think the links can help me i can have wrong i really dont know but im looking into the links
Sergey Alexandrovich Kryukov 24-Sep-13 14:58pm    
If it does not help your (note that you are not asking any follow-up questions, just making this statement), it simply means that you should not be solving this problem and need to resort to something simpler. When you gain some more maturity, you are welcome to come again. :-)

Don't rush. Try to understand it. Follow some further links provided in those article. I think those articles are pretty clear and relevant.

And try to understand the alternative with your own compression/decompression of data, at the level of network stream. When in doubt, ask some follow-up questions.

—SA
wawada 24-Sep-13 15:27pm    
what I would really asked from the beginning is how to compress an image without saving it to disk then send the client application over tcp to server application and decompress the image, and I've made a mess with my first question, so I ask you if you know a clever way to compress images to then send over tcp and decompress the image, and I wonder how to compress text over tcp for then decompress the text and read it. I apologize for not asking how to do this from the beginning.
wawada asked:
…so I ask you if you know a clever way to compress images to then send over TCP and decompress the image, and I wonder how to compress text over tcp for then decompress the text and read it…
Well, you can compress a stream without having a file. This is how System.IO.Compression.GZipStream works: http://msdn.microsoft.com/en-us/library/system.io.compression.gzipstream.aspx[^].

This is the ZIP code sample: http://www.dart.com/zip-stream-code-example.aspx[^].

You can use this open-source library: http://dotnetzip.codeplex.com/[^].

—SA
 
Share this answer
 
v2
Comments
wawada 25-Sep-13 2:01am    
I'll test with System.IO.Compression.GZipStream.compression though I do not really know how to use it can you help me to explain or demonstrate in any way how to use System.IO.Compression.GZipStream.compression and decompression also viewed DotNetZip and I'd rather not use any library in my server application and the client application so I will now try to System.IO.Compression.GZipStream.compression gonna work when I manage to understand me at GZipStream
Sergey Alexandrovich Kryukov 25-Sep-13 2:31am    
Nobody knows before reading the documentation...
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900