高性能的低延迟可靠多播消息 Fast-cast

码农软件 · 软件分类 · 网络工具包 · 2019-02-24 20:11:48

软件介绍

基于主题的高性能、可靠无代理 UDP 消息传递(“事件总线”)。可承受每秒高达 700 万个 70 字节的消息。

实现 NAK 协议所需的缓冲区不受影响,因此对 GC 的影响不大。如果配置得当,能保证可靠、有边界的低延迟。

要求 JDK 1.7 或更高版本

示例代码

基于快速序列化的对象组播(=广播)发布者:

public static void main(String arg[]) {
        FastCast.getFastCast().setNodeId("PUB"); // 5 chars MAX !!
        configureFastCast();
        FCPublisher pub = FastCast.getFastCast().onTransport("default").publish(
            new PublisherConf(1)            // unique-per-transport topic id
                .numPacketHistory(40_000)   // nuber of packets kept for retransmission requests
                .pps(5000)                  // packets per second rate limit. So max traffic for topic = 5000*2500 = 12.5 MB/second
        );
        // use a helper for fast-serialized messages
        ObjectPublisher opub = new ObjectPublisher(pub);
        RateMeasure measure = new RateMeasure("msg/s");
        while( true ) {
            measure.count();
            opub.sendObject(
                null,  // all listeners should receive (by specifying a nodeId, a specific subscriber can be targeted)
                "Hello "+System.currentTimeMillis(), // serializable object
                false  // allow for 'batching' several messages into one (will create slight latency)
            );
        }
    }

本文地址:https://codercto.com/soft/d/57.html

中国游戏风云

中国游戏风云

王亚晖 / 中国发展出版社 / 2018-11-1 / 168.00元

本书以时间为序,介绍了整个游戏产业发展的跌宕起伏。分别讲述了早期游戏市场、单机游戏、网络游戏、网页游戏和手机游戏以及未来游戏世界。作者本人曾为知名游戏产业人,书中披露了大量不为大众所知的行业故事和行业数据。为游戏的制作者、投资人、玩家,抑或想了解游戏的人,提供了一个理性的梳理。一起来看看 《中国游戏风云》 这本书的介绍吧!

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具