资源简介
从文件中读取数据,发送到DSP中,DSP处理后,返回数据,写入到输出文件中
代码片段和文件信息
/*
* testudp.c
*
* Test the crude echo by sending to port 7 and waiting
* for replies.
*
* Copyright (C) 1999 Texas Instruments Incorporated - http://www.ti.com/
*
*
* Redistribution and use in source and binary forms with or without
* modification are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* “AS IS“ AND ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT
* LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT INDIRECT INCIDENTAL
* SPECIAL EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING BUT NOT
* LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE
* DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY WHETHER IN CONTRACT STRICT LIABILITY OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include
#include
#include
#include
#include “sockets.h“
#define UDP_LOW 16
#define UDP_HIGH 1468 /* Note: Windows FRAGMENTS higher UDP sizes!!! */
#define COPY_NUM 4
#define TIMEOUT 10 /* seconds */
#define BUFSIZE 1500
#define PORT 801
/*
* ======== main ========
*/
int main(int argc char *argv[])
{
SOCKET s;
struct sockaddr_in sin;
struct in_addr dst;
unsigned short port = PORT;
char * buf = NULL;
char * name = argv[0];
char cnt;
int testsize;
int nr;
int ijk;
fd_set readfds;
struct timeval timeout;
time_t ts;
int status;
/*Begin:Add by sxf 20140801*/
char *tInputFile = “InputEth.txt“;
char *tOutputFile = “OutputEth.txt“;
FILE *fInputEth;
FILE *fOutputEth;
char testbuf[100];
char testOutbuf[100];
char *temptestbuf;
char *tempOutbuf;
/*End:Add by sxf 20140801*/
argc =2;
argv[1] = “192.168.2.100“;
if (argc < 2) {
fprintf(stderr “Usage: %s ip-addr [update] [port]\n“ name);
exit(EXIT_FAILURE);
}
if (inet_pton(AF_INET argv[1] &dst) != 1) {
fprintf(stderr “%s: invalid ip-addr (%s)\n“ name argv[1]);
exit(EXIT_FAILURE);
}
/* updat
- 上一篇:海思3531GPIO测试
- 下一篇:S7imgRD-S7imgWR
相关资源
- 使用选择性重传协议实现UDP可靠通信
- 网络(UDP)转串口程序
- 用Socket写的简易FTP服务器和客户端
- socket小工具(可方便建立TCP UDP的soc
- UDP组播的发送和接收程序
- 采用WINSOCK2 编写的TCP/UDP通信程序
- TCP_UDP对结构体加密数据传输
- 欧姆龙以太网通讯TCP/UDP及欧姆龙PLC程
- UDP协议进行P2P打洞
- 计算机网络socket编程实验
- UDP P2P打洞服务器
- 一个老外写的RUDP的源代码
- udp丢包率统计
- Socket-UDP整合消息接收,发送
- 基于qt的udp实时录音
- 真正的Delphi点对点UDP通讯
- TCPUDPDbg一个好用的tcp/udp工具
- 值得看的Delphi点对点UDP通讯.rar
- tcp udp debug
- QT开发的串口udptcp通信上位机软件
- go语言实现udp server和MongoDB数据写入
- lwip+udp项目
- UDPSender.rar
- 智能家居UDP通信
- QT下写的界面程序,可以实现串口和
- sokit TCP/UDP 数据包收发测试(调试)工
- Labwindow_cvi TCP UDP通信例程
- udp滑动窗口流量控制完美实现
- rtsp视频组帧(tcp和udp)
- CC3200 UDP TCP透传
评论
共有 条评论