Giter Site home page Giter Site logo

Comments (7)

richmonkey avatar richmonkey commented on August 18, 2024

主要是为了在主线程收发消息

from asynctcp.

imkarl avatar imkarl commented on August 18, 2024

不知道你们可不可以提供一个纯java实现的AsyncTcp

我自己尝试了下用java的sockect来收发数据包,总是会导致数据包不完整。

from asynctcp.

richmonkey avatar richmonkey commented on August 18, 2024

除了体积因素,有什么其他必要的理由用纯java吗?

from asynctcp.

imkarl avatar imkarl commented on August 18, 2024

没有。

我的想法是:

  • 这里没必要用jni的方式来实现(或者说用jni或java实现差别不大)
  • 维护没那么方便,多引入了一种编程语言
  • 对app的体积有影响(增加50k~150k左右)
  • 引用该库时,还需要根据app支持的cpu平台引入不太的.so文件

from asynctcp.

richmonkey avatar richmonkey commented on August 18, 2024

多线程和jni对编程体验的影响我们评估是不一样的。
我们现在不能因为这个理由提供纯java版本的sdk

from asynctcp.

richmonkey avatar richmonkey commented on August 18, 2024

但是你自己把asynctcp这个java类换成纯java实现,应该比从头用java来实现这个sdk还是简单很多的。

from asynctcp.

imkarl avatar imkarl commented on August 18, 2024

是的。 我自己实现了个纯java版本的AsyncTCP,发数据正常,但是在多次 close() \ connect()后 收到的数据就不对了。还不确定是哪个环节搞错了

from asynctcp.

Related Issues (1)

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.