zoukankan      html  css  js  c++  java
  • UDP VS TCP 规格严格

    Mostly buffer space. Say you're sending a constant 10MB/second , and you're only able to consume 5MB/second, the OS and network stack can't keep up, so it will drop the packets - this should be rather obvious. (Which, naturally is different from TCP which provides flow control and retransmission to handle such a situation).

    Even if you're normally keeping up with consuming the data, there might be small time slices where you're not. e.g. a garbage collector kicks in, the OS decided to schedule another process instead of your consumer for 0.5 seconds, etc - and the system will drop packets.

    This can be extended to any network devices in between. If you're running on a network instead of just locally, an ethernet switch, router, etc. will also drop packets if its queues are full (e.g. you're sending a 10MB/s stream through an 100MB/s ethernet switch, and a few seconds in the middle of the night someone else tries to cram 100MB/sec through the same path, some packets will lose.)

    Try increasing the socket buffers size, often you have to increase this on the OS level as well.

    (e.g. on linux, the default socket buffer size is often only 128k or less, which leaves very little room for pausing the data processing , you can try to increase them by setting the sysctl net.core.wmem_max,net.core.wmem_default, net.core.rmem_max, net.core.rmem_default)

    http://stackoverflow.com/questions/47903/udp-vs-tcp-how-much-faster-is-it

    http://stackoverflow.com/questions/11994086/receiving-real-time-gps-data-via-udp
     

  • 相关阅读:
    jquery水印插件:placeholder
    EF POWER TOOLS由数据库逆向CODE FIRST
    .NET重构(类型码的设计、重构方法)
    CodeUI Test:创建第一个CodeUI Test
    Windows 8 Store Apps
    ASP.NET MVC 使用MSBuild部署的几个注意事项
    c#中如何跨线程调用windows窗体控件
    Restful?
    Javascript的一种代码结构方式——插件式
    AOP编程
  • 原文地址:https://www.cnblogs.com/diyunpeng/p/2687362.html
Copyright © 2011-2022 走看看