net

所属分类:其他
开发工具:C/C++
文件大小:8KB
下载次数:0
上传日期:2019-01-29 09:41:03
上 传 者linux菜鸟高手
说明:  周立功linux平台的TCP SOCKET通信
(TCP SOCKET Communication on Zhou Ligong Linux Platform)

文件列表:
net (0, 2018-10-26)
net\tcp (0, 2018-10-26)
net\tcp\client (0, 2018-10-26)
net\tcp\client\client.c (2494, 2017-08-08)
net\tcp\client\Makefile (346, 2017-08-08)
net\tcp\server (0, 2018-10-26)
net\tcp\server\Makefile (281, 2017-08-08)
net\tcp\server\server.c (3408, 2017-08-08)
net\udp (0, 2018-10-26)
net\udp\listener (0, 2018-10-26)
net\udp\listener\listener.c (1945, 2017-08-08)
net\udp\listener\Makefile (285, 2017-08-08)
net\udp\talker (0, 2018-10-26)
net\udp\talker\Makefile (348, 2017-08-08)
net\udp\talker\talker.c (1763, 2017-08-08)

说明: ―――――――――――――――――――――――――― 1、在ubuntu主机上,用arm-gcc工具,交叉编译server程序。 vmuser@Linux-host:~/net/tcp/server$ make ―――――――――――――――――――――――――― 2、在ubuntu主机上,用x86平台的gcc工具,编译client程序。 vmuser@Linux-host:~/net/tcp/client$ make ―――――――――――――――――――――――――― 3、将编译出来的server程序,拷贝到工控板的/opt中。运行测试程序: [root@M28x opt]# ./server ―――――――――――――――――――――――――― 4、在ubuntu主机上,运行client程序: vmuser@Linux-host:~/net/tcp/client$ ./client 192.168.1.88 #假设192.168.1.88是工控板的IP地址 ―――――――――――――――――――――――――― 5、测试情况 a. 运行server程序之后,会打印如下信息,并监听端口5000是否有client连接。 [root@M28x 3968]# ./server OK: Obtain Socket Despcritor sucessfully. OK: Bind the Port 5000 sucessfully. OK: Listening the Port 5000 sucessfully. b. 运行client程序之后,建立与server端的链接,并打印如下信息: OK: Have connected to the 192.168.1.88 server端监听到连接,并打印如下信息。 OK: Server has got connect from 192.168.1.168. You can enter string, and press 'exit' to end the connect. c. 在server端,输入字符串(如:hello linux),按回车键,发送到客户端。 hello linux OK: Sent 5 bytes sucessful, please enter again. OK: Sent 5 bytes sucessful, please enter again. 在client端,收到字符串,并打印如下信息: OK: Receviced numbytes = 5 OK: Receviced string is: hello OK: Receviced numbytes = 5 OK: Receviced string is: linux 测试完成。 ―――――――――――――――――――――――――― 注意:如果ubuntu主机上,没有安装x86平台的gcc工具。可以将ubuntu主机连接到互联网,运行以下命令安装: vmuser@Linux-host:~$ sudo apt-get install build-essential ――――――――――――――――――――――――

近期下载者

相关文件


收藏者