ServerSocket带宽 [英] ServerSocket Bandwidth

查看:99
本文介绍了ServerSocket带宽的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了服务器套接字程序,该程序正在向客户端连续发送图像,通过TCP/IP进行侦听,我的问题是它在服务器端消耗了大量带宽,请问如何做才能使它消耗低带宽,

I have Server socket program written which is sending images continuous to client, listening over TCP/IP , My problem is that it is consuming lots of bandwidth on server side, does any one how to make it consumes low bandwidth,

推荐答案

您不能在不占用带宽的情况下发送数据,可以吗?

如果您唯一关心的是带宽使用情况,则应压缩数据并发送(客户端必须解压缩才能使用).但这会带来执行压缩和解压缩的额外计算成本.
You cannot send data without consuming the bandwidth, can you?

If your only concern is bandwidth usage, you should then compress the data and send it (which the client must decompress to use). But this would come with the added cost of computation to do the compression and decompression.


我知道带宽消耗是必需的,但我担心的是它的成本非常高,对于一个客户端,任何客户端大约600Kbs其他方式,我可以减少带宽消耗而无需压缩. JVM或ServerSocket的任何属性设置,无论如何,我是否可以将图像质量降低为16位或256位颜色,从而减小图像大小,
I know bandwidth consumption is required, but my concerns is its very high, around 600Kbs for one client, any other way i can reduce this bandwidth consumption without compression. Any property setting for JVM or ServerSocket, Is there anyway i can reduce the quality of images to 16 bit or 256 bit colors so that images size reduces,


当然,有很多方法可以减少图像的质量或对其进行压缩.请在此站点上搜索有关图像压缩和处理的文章.

如果您的图像已经被压缩,则没有什么作用.如果您要同时将相同的数据发送到多个客户端,则可以考虑使用多播(在适当的情况下).
Of course there are many ways to reduce the quality of images or compress them. Please search this site for articles on image compression and manipulation.

If your images are already compressed, there''s little scope for this. If you''re sending the same data to multiple clients simultaneously, you might consider multicasting (given the circumstances are suitable for that).


这篇关于ServerSocket带宽的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆