Git Product home page Git Product logo

Comments (3)

yudidi avatar yudidi commented on May 18, 2024

作者是先发送option,再发送header+body的。
_ = json.NewEncoder(conn).Encode(geerpc.DefaultOption) 这句话执行完,conn就已经把json格式的option数据发到服务端了,服务端处理之后,客户端才发送header和body,然后服务端继续处理。

正常测试是刚刚说的这个流程,但是如果你用一些极限情况压测下,可能会出现你说的情况。

这块知识属于 tcp粘包 问题,另外还有 拆包 问题,你可以去了解下。

from 7days-golang.

liyuxuan89 avatar liyuxuan89 commented on May 18, 2024

113541748-70730d80-9615-11eb-9be1-89d49ffd0cab
我直接下载作者rpc day1的代码运行就会阻塞在readRequestHeader这里。
113541900-b4fea900-9615-11eb-85c2-16476a7458ff
client发送应该是没问题的。感觉就是tcp粘包的问题,如果不发option,程序就可以进行下去。

from 7days-golang.

4ttenji avatar 4ttenji commented on May 18, 2024

请问有解决这个问题的吗

from 7days-golang.

Related Issues (20)

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.