Code Monkey home page Code Monkey logo

Comments (23)

halx99 avatar halx99 commented on June 3, 2024

write接受参数是字节buffer: yasio::sbyte_buffer, fast_obstream通过API buffer()拿到sbyte_buffer

from yasio.

uurain avatar uurain commented on June 3, 2024

在lua中不管是yasio.obstream还是 yasio.fast_obstream new出来的都没有buff()方法,只有to_string()方法 测试可以发送出去 ,但是截包发现yasio.fast_obstream 还是大端模式,有什么别的接口可以强制小端么?

from yasio.

halx99 avatar halx99 commented on June 3, 2024

在lua中不管是yasio.obstream还是 yasio.fast_obstream new出来的都没有buff()方法,只有to_string()方法 测试可以发送出去 ,但是截包发现yasio.fast_obstream 还是大端模式,有什么别的接口可以强制小端么?

to_string按理说可以

from yasio.

halx99 avatar halx99 commented on June 3, 2024

你的编译环境是啥,c++14以上吗?

from yasio.

halx99 avatar halx99 commented on June 3, 2024

fast 和非fast写入几个数值数据,to_string对比是一样的?

from yasio.

uurain avatar uurain commented on June 3, 2024

我错了 fast_obstream:to_string() 是ok的,昨天截图看错了位置,服务器有回包,然后自带的粘包处理应该也是大小端问题 导致没有走YEK_PACKET回调, 粘包的能设置大小端么。。

from yasio.

halx99 avatar halx99 commented on June 3, 2024

对,内置拆包是大端

from yasio.

halx99 avatar halx99 commented on June 3, 2024

我看下加个配置

from yasio.

uurain avatar uurain commented on June 3, 2024

image
我这里收到的前两个字节是22,00也就是34 总长度是36 我的包头不包含长度 所以设置的参数是self.client:set_option(yasio.YOPT_C_LFBFD_PARAMS,
0, -- channelIndex, 信道索引
65535, -- maxFrameLength, 最大包长度
0, -- lenghtFieldOffset, 长度字段偏移,相对于包起始字节
2, -- lengthFieldLength, 长度字段大小,支持1字节,2字节,3字节,4字节
2 -- lengthAdjustment:如果长度字段字节大小包含包头,则为0, 否则,这里=包头大小
)
为啥木有回调呀?

from yasio.

halx99 avatar halx99 commented on June 3, 2024

就是大小端问题,你的截图数据是小端

from yasio.

uurain avatar uurain commented on June 3, 2024

好的 求大佬加个配置接口

from yasio.

halx99 avatar halx99 commented on June 3, 2024

一会儿加

from yasio.

halx99 avatar halx99 commented on June 3, 2024

已添加选项

from yasio.

uurain avatar uurain commented on June 3, 2024

加了参数 收到YEK_PACKET ok了 但是local ibs = event:packet()返回的Ibs默认应该也是大端,,,这个有啥办法么?看到有个fast_ibstream 但是不清楚怎么转换

from yasio.

halx99 avatar halx99 commented on June 3, 2024

lua绑定哪里估计需要再加个参数才行

from yasio.

halx99 avatar halx99 commented on June 3, 2024

或者统一成flag: default(0), no_swap(1), (2)raw

from yasio.

uurain avatar uurain commented on June 3, 2024

你回复的3个flag我在源码里面搜没搜索到 - -

from yasio.

halx99 avatar halx99 commented on June 3, 2024

还没加,不过sol2,lua绑定貌似不行,返回值类型不同,无法编译,所以估计得加接口才行,比如: event:fast_packet()

from yasio.

uurain avatar uurain commented on June 3, 2024

好 坐等大佬加接口!!

from yasio.

halx99 avatar halx99 commented on June 3, 2024

sol2的绑定加好了,可以用标记为,无需新增接口: ab5ef3c

from yasio.

halx99 avatar halx99 commented on June 3, 2024

好 坐等大佬加接口!!

又提交了下,更新下,应该ok了

from yasio.

uurain avatar uurain commented on June 3, 2024

目前在mac上测试通过啦 后续会打包在手机上试试。感谢大佬!

from yasio.

halx99 avatar halx99 commented on June 3, 2024

ok

from yasio.

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.