最近写C#串口通信程序,系统是B/S架构.SerialPort类有一个DataReceived事件,用来接收串口返回的数据,但这种方式在C/S架构下很好用,但B/S就不好处理了.所以写了一个同步模式接收返回数据的方法,不使用DataReceived事件.经过测试,可以正常使用. 一.MachineFactory类 为什么使用工厂类:售货机由不止一个厂家提供,接口协议都不一样. using System; using System.Collections.Generic; using System
案例分析 处理kafka consumer的程序的时候,发现如下错误: ERROR [2016-07-22 07:16:02,466] com.flow.kafka.consumer.main.KafkaConsumer: Unexpected Error Occurred ! kafka.common.MessageSizeTooLargeException: Found a message larger than the maximum fetch size of this consumer