c ++网络问题请帮帮我? [英] c++ network problem please help me?

查看:73
本文介绍了c ++网络问题请帮帮我?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建自己的网络数据包。

如何用c ++创建自己的网络数据包,或编辑数据包。

I want to create my own network packets.
How can i create my own network packets in c++,OR edit the packets.

推荐答案

您想要重新制作的是数据编组 [ ^ ]及其近亲序列化 [ ^ ]。这些是计算中的常见任务。



重点是,如果你的struct / class只包含基本数据类型 [ ^ ]并且没有指针,只需通过电线发送而不进行转换,并在另一侧按原样读取(你需要一个演员来读取枚举值)。如果它包含指针,则必须取消引用指针并发送该信息。
What you want to reearch is Data Marshalling[^] and its close cousin Serialization[^]. These are common tasks in computing.

The main point is that if your struct/class just contains fundamental data types[^] and no pointers, just send it across the wire without conversion and read "as is" on the other side (you will need a cast to read in enum values). If it contains pointers you will have to dereference the pointer and send that info.


这篇关于c ++网络问题请帮帮我?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆