亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? client.c

?? vxworks的tcp server的實(shí)例程序
?? C
字號(hào):
/* echoClient.c - TCP echo client program *//* Copyright 1984-1997 Wind River Systems, Inc. */ /*modification history--------------------01f,06nov97,mm   added copyright.01e,29Sep97,mm   cast arg 1 of `bzero' , cast arg 2 of `connect', cast arg 4 of `setsockopt'01d,17Sep97,mm   deleted line IMPORT int tcp_keepidle = 101c,17Sep97,mm   changed int optionVal to char optionVal 01b,16Sep97,mm   included <stdio.h> <string.h> <arpa/inet.h>01a,07Feb94,ms   cleaned up for VxDemo.*/#include <stdio.h>#include <string.h>#include <stddef.h>#include <arpa/inet.h>#include <vxWorks.h>#include "socket.h"#include "in.h"#include "ioLib.h"#include "errno.h"#include "netinet/tcp.h"#include <sockLib.h>LOCAL int  defaultTimes	= 50;   /* default number of times for echo service */LOCAL int  defaultPort	= 7001; /* default port number used by echoTcpServer */LOCAL char  defaultServer[16] = "147.11.184.2";  /* default echo server's inet 					      * address */LOCAL char defaultMessage[80] = "Hello World!!!\n"; /* Buffer for the default 						 * message *//* Change the default keepidle time (timeout for probing the idle* connection) from several hours to few minutes.*//*IMPORT int tcp_keepidle = 1;*/LOCAL int echoTcpClientSock (char *, int); /* set up TCP socket */LOCAL void  echoTcpClient (int, int, char*); /*UDP echo client*//***************************************************************************** * echoTcpClientRun - Runs the TCP client task for echo service * * 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. *  * CONFIGURATION:  * * 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. * * EXAMPLE: * *     Run this 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. * *     sp (echoTcpClientRun, inetAddrOfServer, port, numTimes, msg) * *     where inetAddrOfServer is the internet address of the network *     interface of the VxWorks system running echoTcpServerRun task, *     port is the port number used by the echoTcpServer (should be *     greater than 5000), numTimes is the number of times echo service is *     requested, and msg is the message to echo. *      *     example: *     -> sp (echoTcpClientRun, "147.11.184.2", 7001, 5, "Hello World!!!") * */void echoTcpClientRun    (    char *server,                /* internet address of the echo server;                                   * 0 to use default */     int  port,                   /* port number; 0 to use the last used one*/    int  numTimes,               /* number of times for echo service */    char *msg                    /* Message to echo; 0 to use default or last                                    used message */     )    {        int clientSock;          /* socket fd opened to the server */	clientSock = echoTcpClientSock (server, port);        if (clientSock == ERROR)            printf ("Error creating client socket\n");        else 	    echoTcpClient (clientSock, numTimes, msg);        close (clientSock);    }/***************************************************************************** * echoTcpClientSock - Sets up a TCP socket connection with echo client  * * DESCRIPTION * *     Sets up a TCP socket connection with echo server with various socket *     options. * * RETURNS: OK or ERROR */int echoTcpClientSock     (    char 	*server,   /* inet number of echo server */    int 	port       /* port number */    )    {    int			echoClientSock; /* socket opened to echo server */    int			optionVal;      /* value of setsocket option */    struct sockaddr_in	serverAddr;    /* server's address */    if (server == NULL)	server = defaultServer;    if (port == 0)	port = defaultPort;    else	defaultPort = port;    if (port < 5000)        {        printf ("echoTcpClientSock: invalid port number\n");        return (ERROR);        }    /* open the socket */    echoClientSock = socket (AF_INET, SOCK_STREAM, 0);    if (echoClientSock == ERROR)	{	perror ("echoTcpClientSock: socket open failed");	return (ERROR);	}    optionVal = 1; /* Turn ON the different setsockopt options */    /* Specify the SO_REUSEADDR option  to bind a stream socket to a local       * port  that may be still bound to another stream socket that may be      * hanging around with a "zombie" protocol control block whose context     * is  not yet freed from previous sessions.     */    if (setsockopt (echoClientSock, SOL_SOCKET, SO_REUSEADDR, (char *)&optionVal,		    sizeof(optionVal)) == ERROR)	{	perror ("echoTcpClientSock: setsockopt SO_REUSEADDR failed");	close (echoClientSock);	return (ERROR);	}    /* Specify the TCP_NODELAY option for protocols such as X Window System      * Protocol that require immediate delivery of many small messages.      *     * By default VxWorks uses congestion avoidance algorithm      * for virtual  terminal  protocols and  bulk  data  transfer       * protocols. When the TCP_NODELAY option is turned on and there are      * segments to be sent out, TCP  bypasses  the  congestion     * avoidance algorithm  and sends the segments out when there      * is enough space in the send window.     */    if (setsockopt (echoClientSock, IPPROTO_TCP, TCP_NODELAY, (char *)&optionVal,		    sizeof(optionVal)) == ERROR)	{	perror ("echoTcpClientSock: setsockopt TCP_NODELAY failed");	close (echoClientSock);	return (ERROR);	}    /* Specify the SO_KEEPALIVE option, and the transport protocol (TCP)       * initiates  a timer to detect a dead connection which prevents an     * an application from  hanging on an invalid connection.     */    if (setsockopt (echoClientSock, SOL_SOCKET, SO_KEEPALIVE, (char *)&optionVal,		    sizeof(optionVal)) == ERROR)       {       perror ("echoTcpClientSock: setsockopt SO_KEEPALIVE failed");       close (echoClientSock);       return (ERROR);       }       /* Set up server's internet address and connect to the server */    /* Zero out the sock_addr structures.     * This MUST be done before the socket calls.     */    bzero ((char  *) &serverAddr, sizeof (serverAddr));    serverAddr.sin_family	= AF_INET;    serverAddr.sin_port	= htons (port);    serverAddr.sin_addr.s_addr	= inet_addr (server);    printf ("Server's address is %x:\n", ntohl (serverAddr.sin_addr.s_addr));    if (connect (echoClientSock, (struct sockaddr  *) &serverAddr, sizeof (serverAddr)) < 0)	{	perror ("echoTcpClientSock: connect failed");	close (echoClientSock);	return (ERROR);	}    printf ("Connected...\n");     return (echoClientSock);    }/***************************************************************************** * echoTcpClient - the TCP client for echo service * * DESCRIPTION * *     echoTcpClient enters a loop that repeatedly sends message across the *     TCP connection to the echo server, reads it back and prints it. *     After all input messages have been sent to the server, received back, *     and printed successfully, the client exits.   * */void echoTcpClient     (    int echoClientSock,           /* client socket fd */    int   times,                  /* number of times for echo service */    char *message                 /* message buffer for echo service */    )    {    int		ix;               /* loop counter */    int		msgLen;           /* length of the message */    char 	buffer [80];      /* echoed message buffer */    int 	numToRead;        /* number of bytes to read */     int 	numRead;          /* number of bytes read */    if (times == 0)	times = defaultTimes;    else	defaultTimes = times;    if (message == NULL)	message = defaultMessage;        msgLen = strlen (message);    printf ("The length of the message is - %d bytes\n", msgLen);     printf ("Message: %s\n\n", message);    for (ix = 0; ix < times; ++ix)	{	if (send (echoClientSock, message, msgLen, 0) < 0)            {            perror ("echoTcpClient: echo CLIENT write error");            return;            }        /* number of bytes to be read is assumed to be less than 80         * bytes and the message is NULL terminated for this demonstration.         */	for (numToRead = msgLen; numToRead > 0; numToRead -= numRead)	    {	    buffer[0] = '\0';	    numRead = recv (echoClientSock, buffer, numToRead, 0);	    printf ("echoTcpClient received echo message: %s\n", buffer);	    if (numRead == ERROR)		{                perror ("echoTcpClient: echo CLIENT recv error");                break;		}	    }	}    }

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国内外成人在线| 欧美精品在线观看一区二区| 欧美一区二区三区日韩视频| 国产精品久久免费看| 久久 天天综合| 日韩精品一区二区三区四区视频| 亚洲18色成人| 欧美性淫爽ww久久久久无| 国产精品高清亚洲| 日韩一区二区不卡| 国产精品一区二区久久精品爱涩 | 亚洲精品久久久蜜桃| 99国产欧美久久久精品| 国产精品久久久久久久浪潮网站| 3751色影院一区二区三区| 免费观看成人鲁鲁鲁鲁鲁视频| 欧美日韩电影一区| 免费看精品久久片| 一区二区三区不卡视频在线观看| 精品视频1区2区| 久久国产三级精品| 国产精品高潮呻吟久久| 国产视频一区二区三区在线观看| 国产一区二区三区电影在线观看| 国产精品毛片a∨一区二区三区| 91丨九色porny丨蝌蚪| 亚洲一区二区三区中文字幕在线| 欧美日本韩国一区二区三区视频 | 欧美色网站导航| 97成人超碰视| 99精品在线免费| 成人爱爱电影网址| 国产成人精品www牛牛影视| 久久久亚洲国产美女国产盗摄| 成人激情黄色小说| 国产成人免费视频精品含羞草妖精| 美女一区二区视频| 日韩美女精品在线| 日韩欧美一区电影| 91精品国产高清一区二区三区| 欧美色欧美亚洲另类二区| 欧美日韩中文字幕精品| 欧美日韩一区二区三区免费看| 在线观看成人小视频| 国产一区二区免费视频| 国产一区二区三区四区五区入口| 美国欧美日韩国产在线播放| 青青青爽久久午夜综合久久午夜| 日韩高清不卡在线| 亚洲人成网站精品片在线观看| 日韩欧美高清一区| 日韩精品一区国产麻豆| 精品国产在天天线2019| 欧美日韩国产首页| 91精品国产一区二区三区蜜臀| 欧美一区二区三区在线电影| 精品奇米国产一区二区三区| 精品视频1区2区| 亚洲激情欧美激情| 亚洲444eee在线观看| 老司机免费视频一区二区| 国产一区二区三区观看| 99视频精品免费视频| 蜜臀av性久久久久av蜜臀妖精| 美国毛片一区二区三区| 国产福利一区在线观看| aaa亚洲精品| 欧美视频三区在线播放| 日韩三级电影网址| 中文成人av在线| 一区二区欧美在线观看| 日本不卡的三区四区五区| 国产成人在线观看免费网站| av一区二区三区在线| 欧美精品在线一区二区三区| 久久精品一区八戒影视| 亚洲欧洲综合另类| 蜜桃一区二区三区在线| 国产69精品久久99不卡| 奇米777欧美一区二区| 高清国产一区二区| 色国产综合视频| 色悠悠久久综合| 99久久精品国产导航| 欧美日韩不卡在线| 国产午夜精品久久| 午夜精品久久久| 日韩av电影免费观看高清完整版在线观看| 精品一二线国产| 日本精品裸体写真集在线观看| 日韩精品一区二区在线| 亚洲欧美日本韩国| 久久爱另类一区二区小说| 色美美综合视频| 国产欧美日韩亚州综合| 国产欧美一区二区精品性| 午夜精品福利一区二区蜜股av | 天天射综合影视| 成人午夜电影网站| 99精品视频一区| 欧美理论片在线| 中文字幕制服丝袜成人av| 美女视频黄免费的久久| 欧美亚洲一区三区| 国产精品美女久久久久久久| 琪琪久久久久日韩精品| 色8久久精品久久久久久蜜| 国产免费久久精品| 美女网站在线免费欧美精品| 欧美系列日韩一区| 成人免费在线视频| 亚洲综合区在线| 日韩你懂的在线观看| 亚洲电影中文字幕在线观看| 久久疯狂做爰流白浆xx| 欧美亚洲一区二区在线| 综合激情成人伊人| 国产精品一区二区x88av| 91精品中文字幕一区二区三区 | 国产91在线观看| 欧美r级在线观看| 日韩电影免费在线看| 在线精品亚洲一区二区不卡| 亚洲色图视频网| 成人动漫视频在线| 国产精品第五页| 成人av免费观看| 久久精品视频在线看| 国内精品视频666| 精品欧美一区二区久久| 久久国产麻豆精品| 精品美女在线观看| 麻豆专区一区二区三区四区五区| 欧美军同video69gay| 水野朝阳av一区二区三区| 久久国产婷婷国产香蕉| 日韩一区和二区| 蜜臀av国产精品久久久久 | 亚洲欧美在线视频观看| 成人性视频免费网站| 国产精品每日更新| 99久久久久久| 亚洲精品一卡二卡| 色妹子一区二区| 亚洲电影一区二区三区| 欧美日韩激情一区二区| 丝袜亚洲另类欧美| 5月丁香婷婷综合| 韩国精品一区二区| 久久青草国产手机看片福利盒子| 国产高清精品在线| 综合在线观看色| 欧美亚洲动漫精品| 日韩精品成人一区二区三区| 日韩午夜三级在线| 国产伦精品一区二区三区视频青涩| 久久久另类综合| 96av麻豆蜜桃一区二区| 亚洲高清免费视频| 欧美一区二区精品| 粉嫩aⅴ一区二区三区四区| 成人免费视频在线观看| 欧美日韩亚洲综合在线| 久久99深爱久久99精品| 国产精品久久福利| 欧美中文字幕一区二区三区亚洲| 全国精品久久少妇| 国产婷婷色一区二区三区在线| 97se亚洲国产综合自在线观| 三级亚洲高清视频| 日本一区二区三区在线观看| 91成人看片片| 韩日欧美一区二区三区| 国产精品久久久久9999吃药| 4hu四虎永久在线影院成人| 国产一区在线看| 亚洲激情网站免费观看| 欧美videossexotv100| 91视视频在线直接观看在线看网页在线看 | 91老师国产黑色丝袜在线| 爽好多水快深点欧美视频| 国产免费观看久久| 51久久夜色精品国产麻豆| 成人福利电影精品一区二区在线观看 | 在线亚洲人成电影网站色www| 青青草国产成人av片免费| 国产欧美一区二区精品婷婷| 欧美三级在线播放| 国产一区二区久久| 亚洲成人av免费| 国产精品福利在线播放| 欧美精品在线视频| 91丨porny丨户外露出| 国产一区日韩二区欧美三区| 亚洲午夜精品17c| 国产精品视频yy9299一区| 欧美精品第1页| 色88888久久久久久影院野外| 国产精品一区在线观看乱码| 天天综合天天做天天综合|