Git Product home page Git Product logo

rhsocketkit's Issues

看了您的源码,对于超出缓存大小后的处理的疑问

分隔符解码器中maxFrameSize默认是8192,如果接收数据的速度大于解码数据的速度,那么肯定就会在某一时刻出现超出maxFrameSize的情况,这时您的操作是断开连接,但是与此同时没有对_receiveDataBuffer里的数据进行及时的解码处理,那么下次重新连接成功后,_receiveDataBuffer里的数据就只能丢弃,这不符合长连接保证数据的准确性原则。如果解码的时候每次都从缓存中取出固定大小(比如maxFrameSize)解码,给_receiveDataBuffer缓存池设置一个最大的size,超出size后断开连接,但是解码工作一直继续,直到_receiveDataBuffer为空,会不会更好一些?

错误

  • (uint32_t)uint32FromBytes:(NSData *)data
    {
    NSAssert(data.length == 4, @"uint16FromBytes: (data length != 4)");

    uint32_t val0 = 0;
    uint32_t val1 = 0;
    uint32_t val2 = 0;
    uint32_t val3 = 0;
    [data getBytes:&val0 range:NSMakeRange(0, 1)];
    [data getBytes:&val1 range:NSMakeRange(1, 1)];
    [data getBytes:&val2 range:NSMakeRange(2, 1)];
    [data getBytes:&val3 range:NSMakeRange(3, 1)];

    uint32_t dstVal = (val0 & 0xff) + ((val1 << 8) & 0xff00) + ((val1 << 16) & 0xff0000) + ((val1 << 24) & 0xff000000);
    return dstVal;
    }

dstval 算错了

关于netty 编码和解码器

你好,关注您的代码很久了,我在开发中遇到一个问题,服务器端用的是netty4 提供的编码器和解码器,服务器部分代码如下
public void initChannel(SocketChannel ch) throws Exception {
ChannelPipeline pipeline = ch.pipeline();

           pipeline.addLast(new ProtobufVarint32FrameDecoder());
            pipeline.addLast(new ProtobufDecoder(PushMgsPaket.IMMessage.getDefaultInstance()));
            pipeline.addLast(new ProtobufVarint32LengthFieldPrepender());
            pipeline.addLast(new ProtobufEncoder());

            pipeline.addLast(new TcpServerHandler());  
        }  

那么对应的IOS端有没有对应的编码和解码与之匹配的

RHChannelConfig中的delegate并没有使用到

Issue Description

RHChannelConfig中的delegate并没有使用到

What

RHChannelConfig中的delegate并没有使用到,delegate貌似是通过channelService.channel addDelegate方法添加的

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.