FILE LIST -
echoClient.c
DESCRIPTION -
The TCP echo client repeatedly sends the input and then reads
it back using TCP socket communication.
ECHO services are important tools that network managers use
to test reachability (to make sure the connection works),
debug protocol software, and identify routing problems.
This also demonstrates the usage of SO_REUSEADDR,
SO_KEEPALIVE and TCP_NODELAY set socket options.
RUNNING DEMO -
You need to set/change the value of the defaultPort
(should be greater than 5000 - unreserved port) and the
defaultServer (internet address of the echo server) variables.
Run echoTcpClientRun task on one VxWorks system as follows
after starting the echoTcpServerRun task from
another VxWorks system.
The other half of the demonstration is in echoServer.c.
Place the echoClient.c file in your
<Tornado> dir. Depending on the target
you have, define the CPU in your compile line and use
the Makefile in the BSP dir. to compile.
To run this code invoke the function echoTcpClientRun()
TESTED ON - Host/Target : Solaris 2.5.1 /mv1604
VxWorks : 5.3.1
EXAMPLE COMPILE LINE -
make CPU=PPC604 echoClient.o
%make CPU=PPC604 echoClient.o
ccppc -B/petaluma1/mayur/tor101-ppc/host/sun4-solaris2/lib/gcc-lib/
-mstrict-align -ansi -nostdinc -O2 -fvolatile -fno-builtin -fno-for-scope
-Wall -I/h -I. -I/petaluma1/mayur/tor101-ppc/target/config/all
-I/petaluma1/mayur/tor101-ppc/target/h
-I/petaluma1/mayur/tor101-ppc/target/src/config
-I/petaluma1/mayur/tor101-ppc/target/src/drv -DCPU=PPC604 -DMV1600
-DTARGET_DIR="\"mv1604\"" -c echoClient.c
OUTPUTS/LOGFILE -
On VxWorks target:
==================
-> ld <echoClient.o
value = 917544 = 0xe0028
-> sp (echoTcpClientRun, "147.11.41.154", 7001, 5 , "Hello World!!!")
task spawned: id = 5c7c50, name = u14
value = 6061136 = 0x5c7c50
The output on the console window:
=================================
Binding SERVER
Listening to client
Server's address is 930b299a:
Connected...
The length of the message is - 14 bytes
Message: Hello World!!!
buffer is - Hello World!!! and numRead = 14
echoTcpClient received echo message: Hello World!!!
buffer is - Hello World!!! and numRead = 14
echoTcpClient received echo message: Hello World!!!
buffer is - Hello World!!! and numRead = 14
echoTcpClient received echo message: Hello World!!!
buffer is - Hello World!!! and numRead = 14
echoTcpClient received echo message: Hello World!!!
buffer is - Hello World!!! and numRead = 14
echoTcpClient received echo message: Hello World!!!
No more bytes to read
Closing the sockets
Binding SERVER
Listening to client
tcp.rar_pushcqo_tcpk_com_vxworks_vxworks tcpip_vxworks TCP
版权申诉
53 浏览量
2022-07-15
00:55:15
上传
评论
收藏 19KB RAR 举报
局外狗
- 粉丝: 66
- 资源: 1万+
最新资源
- 海信智能电视刷机数据 LED32K20JD(1115)BOM5 生产用软件数据 务必确认机编一致 强制刷机 整机USB升级程序
- 520表白html5爱心代码
- TINY Syntax Tree -setup1.0.0
- mmexport1689832776313.jpg
- 月宝の病理の爱(黑).zi
- 海信智能电视刷机数据 LED32EC510N(2000)BOM22 生产用软件数据 务必确认机编一致 强制刷机 整机USB升级
- 电磁场与波,非常基础的知识总结
- android ios java后台通用DES base64加密
- 华为OD刷题C卷练习记录(300道).rar
- 最新《Vue-框架开发》期末考试试题分享给需要的同学
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
评论0