明远智睿技术论坛

 找回密码
 立即注册
搜索
查看: 2333|回复: 0
打印 上一主题 下一主题

TCP通信编译与移植(附加源码)

[复制链接]

56

主题

60

帖子

644

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
644
跳转到指定楼层
楼主
发表于 2020-3-26 09:49:34 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
主机平台: UBUNTU14.04
硬件平台:明远智睿MY-IMX6-EK140P
内核版本 :linux-4.1.15
交叉编译链:
arm-poky-linux-gnueabi
文件系统:L4115-core-image-base-myimx6a7.tar.bz2



源码加编译好的执行文件:见附件


编译:
1.设置交叉编译工具:
$ source /home/myzr/my-work/03_toolchain/fsl-imx-x11-glibc-x86_64-meta-toolchain-qt5-cortexa7hf-neon-toolchain-4.1.15-2.1.0/environment-setup-cortexa7hf-neon-poky-linux-gnueabi


2.解压压缩包:
$ tar xvf tcp.tar.bz2


3.进入server目录进行编译:
$ cd server
$ $CC server.c -o server.out


测试:
1.把可执行文件server.out移植到开发板中
2.运行:
$./server.out
3.在虚拟机中client目录运行:
$./client 192.168.137.81(开发板ip地址)
4.可在开发板中接收到数据:
OK: Obtain Socket Despcritor sucessfully.
OK: Bind the Port 5000 sucessfully.
OK: Listening the Port 5000 sucessfully.
OK: Server has got connect from 192.168.137.83.
You can enter string, and press 'exit' to end the connect.

5.在开发板中输入字符,可在虚拟机中接收到:
You can enter string, and press 'exit' to end the connect.
www.myzr.com
OK: Sent 12 bytes sucessful, please enter again.



本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|明远智睿  

GMT+8, 2024-5-4 16:58 , Processed in 0.057200 second(s), 25 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表