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

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

?? tcp_receiver.c

?? 很多儀器都輸出同步時鐘
?? C
字號:
// File: tcp_receiver.c
// Author: David Van Brink

// +---------------------------------------
// | This Nios plugs library program simply
// | listens on a TCP port (1067) and accepts
// | a connection. When the connection is
// | closed (either by pressing ESC or when
// | the remote device closes the connection)
// | we report how many bytes we got and the
// | rate of transfer.
// |
// | It is intended to work with the Unix
// | sockets program "tcp_sender.c".
// |
// | To build, nios-build tcp_receiver.c.
// |
// | ex:set tabstop=4:

// +--------------------
// | Includes
// |

#include "excalibur.h"
#include "plugs.h"
#include "plugs_example_designs.h"


// +--------------------
// | Constants & Defines
// |

#define k_local_port 1067


// +--------------------
// | Prototypes
// |


int tcp_listen_proc
		(
		int plug_handle,
		void *context,
		host_32 remote_ip_address,
		host_16 remote_port
		);
// +------------------------------
// | A pointer to an instance of
// | this structure is passed between
// | the routine r_tcp_accept and the
// | to plugs callback routines, so that
// | we dont have to use globals.
// |
// | The structure keeps track of connection
// | status, as well as bytes received and
// | how long it took.
// |

typedef struct
	{
	int tcp_plug;
	int connected; // 0:waiting, 1:connected, 2:disconnected
	net_32 remote_ip_address;
	net_16 remote_port;

	long bytes_received;
	long packets_received;
	unsigned long connection_opened_time;
	unsigned long connection_closed_time;
	} s_tcp_status;


static int r_listen_again(s_tcp_status *status)
	{
	int result;


	printf("\n======================================\n\n");
	printf("Waiting for connection on port %d.\n",k_local_port);

	status->bytes_received = 0;
	result = nr_plugs_listen
			(
			status->tcp_plug,
			tcp_listen_proc,
			status
			);

	status->connected = 0;
	
	return result;
	}

// +------------------------------------
// | This plugs callback routine is responsible
// | for accepting or rejecting an incoming
// | connection request to our tcp plug.
// | We always accept it, and take the
// | opportunity to print out some information
// | about who connected to the plug.
// |

int tcp_listen_proc
		(
		int plug_handle,
		void *context,
		host_32 remote_ip_address,
		host_16 remote_port
		)
	{
	s_tcp_status *status = context;

	status->connected = 1;
	status->remote_ip_address = remote_ip_address;
	status->remote_port = remote_port;

	status->connection_opened_time = nr_timer_milliseconds();
	status->bytes_received = 0;
	status->packets_received = 0;

	printf("Accepted connection from ");
	nr_plugs_print_ip_address(nr_h2n32(remote_ip_address));
	printf(" port %d\n",remote_port);

	printf("(Press ESC to close connection.)\n\n");

	return 0; // "no error" == accept the connection
	}

// +-------------------------------
// | For our receive-data proc, we do
// | pretty close to nothing. We do NOT verify
// | anything about the contents of the data;
// | we just add the number of bytes received
// | to our status, and bump the connection to
// | "disconnected" state if we receive
// | a NULL payload. (This is how the plugs library
// | tells an application that the connection has
// | been closed by the remote network device.
// |

int tcp_proc(int plug_handle,
		void *context,
		ns_plugs_packet *p,
		void *payload,
		int payload_length)
	{
	s_tcp_status *status = context;
	int i;

	if(payload)
		{
		status->bytes_received += payload_length;
		status->packets_received ++;
		}
	else
		status->connected = 2;  // not connected any more...
	
	return 0;
	}

// +----------------------------------
// | r_tcp_accept is the main part of
// | the program. It just waits for a connection,
// | then waits for the connection to be closed,
// | and prints out how many bytes it received,
// | and how long it took.
// |
// | Then, it waits for the next connection.
// |

int r_tcp_accept(void)
	{
	int result;
	s_tcp_status status = {0,0,0,0,0,0,0,0};
	long duration;
	int c;
	
	// | Create the tcp plug. We'll keep reusing it.

	result = nr_plugs_create
			(
			&status.tcp_plug,
			ne_plugs_tcp,
			k_local_port,
			tcp_proc,
			&status,
			0
			);

	printf("created plug %d error %d\n",status.tcp_plug,result);


listen_again:

	r_listen_again(&status);

	// |
	// | Wait for connection to be established, then
	// | go to the session routine. (Allow ESC to
	// | bail out.)
	// |

	while(status.connected == 0)
		{
		if(nr_uart_rxchar(0) == 27)
			goto listen_again;
		nr_plugs_idle();
		}
	
	// |
	// | Now, wait for the connection to close (and
	// | allow the ESC key to force it closed.
	// |

	while(status.connected == 1 && nr_uart_rxchar(0) != 27)
		nr_plugs_idle();
	
	printf("  bytes received: %10d\n",status.bytes_received);
	printf("packets received: %10d\n",status.packets_received);
	if(status.packets_received)
		printf("    bytes/packet: %10d\n",
				status.bytes_received / status.packets_received);
	printf("\n---\n\n");

	goto listen_again;

go_home:
	if(status.tcp_plug)
		result = nr_plugs_destroy(status.tcp_plug);
	return 0;
	}

int main(void)
	{
	int result;

	result = nr_plugs_initialize(0,0,
			__adapter__,
			__adapter_irq__,
			__adapter_struct_addr__);
	
	if(result)
		goto go_home;

	r_tcp_accept();

go_home:
	printf("error: %d\n",result);
	return 0;
	}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美二区三区91| zzijzzij亚洲日本少妇熟睡| 欧美精品vⅰdeose4hd| 亚洲成av人片www| 欧美日韩免费电影| 蜜桃视频在线观看一区二区| 精品国产一区二区三区久久影院| 国产不卡在线一区| 国产精品视频一二三| 色综合中文字幕| 午夜av电影一区| 26uuu久久综合| 韩国女主播一区二区三区| 国产日韩欧美一区二区三区乱码 | 国产高清成人在线| 欧美一个色资源| 国产高清成人在线| 亚洲免费观看高清完整版在线观看| 日韩精品免费专区| 欧美一级日韩不卡播放免费| 精品中文字幕一区二区小辣椒| 91在线国产观看| 午夜视黄欧洲亚洲| 久久精品视频免费| 色88888久久久久久影院按摩| 精品国产一区二区三区忘忧草| 一区二区三区产品免费精品久久75 | 91视频在线观看| 首页国产丝袜综合| 日韩免费在线观看| 91麻豆产精品久久久久久| 日韩精品福利网| 国产精品久久久久久久久久久免费看 | 色婷婷国产精品久久包臀| 青青草国产精品97视觉盛宴| 精品国产欧美一区二区| 在线观看中文字幕不卡| 国产精品自在欧美一区| 亚洲国产cao| 国产精品美女久久久久久久久久久 | 精品99一区二区| 在线精品视频免费播放| 国产自产视频一区二区三区| 一区二区欧美在线观看| 国产亲近乱来精品视频| 欧美裸体一区二区三区| www..com久久爱| 激情久久五月天| 一区二区三区高清不卡| 中文字幕一区二区三区不卡| 精品人在线二区三区| 欧美日韩中字一区| 99久久99久久免费精品蜜臀| 国产麻豆视频一区| 三级一区在线视频先锋| 亚洲激情欧美激情| 国产精品久久免费看| 久久只精品国产| 日韩一区二区三区四区| 欧美三级在线看| 色八戒一区二区三区| 成人手机电影网| 国产精品自在在线| 狠狠狠色丁香婷婷综合激情| 日本在线观看不卡视频| 亚洲国产aⅴ天堂久久| 玉足女爽爽91| 亚洲色图色小说| 中文字幕在线不卡视频| 国产农村妇女毛片精品久久麻豆| 成人自拍视频在线观看| 国产曰批免费观看久久久| 调教+趴+乳夹+国产+精品| 亚洲午夜免费电影| 一区二区三区四区不卡在线 | 精品日韩一区二区三区| 91麻豆精品国产91久久久久| 欧美揉bbbbb揉bbbbb| 欧美视频精品在线观看| 欧美在线观看一二区| 在线观看av不卡| 精品视频一区二区三区免费| 99国产欧美久久久精品| av在线一区二区三区| 91在线播放网址| 色婷婷久久久亚洲一区二区三区| 日韩成人午夜电影| 91污片在线观看| 一本一道综合狠狠老| 91麻豆免费在线观看| 欧美综合视频在线观看| 欧美日韩免费电影| 日韩欧美亚洲一区二区| 久久婷婷成人综合色| 久久先锋资源网| 国产精品久久毛片a| 亚洲你懂的在线视频| 婷婷国产在线综合| 韩国精品主播一区二区在线观看| 亚洲精品伦理在线| 偷拍与自拍一区| 精品一区二区三区视频| 成人黄色电影在线| 欧美在线免费播放| 欧美一区二区在线免费播放| 欧美不卡视频一区| 中文字幕亚洲综合久久菠萝蜜| 欧美变态tickle挠乳网站| 久久婷婷久久一区二区三区| 中文字幕一区二区三区乱码在线 | 亚洲狠狠爱一区二区三区| 日本成人在线网站| 国模娜娜一区二区三区| 99re这里只有精品视频首页| 欧美另类videos死尸| 国产亚洲精品资源在线26u| 综合婷婷亚洲小说| 美女一区二区久久| 91视频观看视频| 日韩一区二区三区免费看| 中文字幕免费不卡| 亚洲成人免费影院| 国产jizzjizz一区二区| 欧美精品99久久久**| 中文字幕免费不卡在线| 日本强好片久久久久久aaa| www.日本不卡| 精品福利一区二区三区| 一区二区三区免费在线观看| 国产一区啦啦啦在线观看| 欧洲精品一区二区三区在线观看| 在线视频一区二区三区| 国产日韩欧美制服另类| 日日摸夜夜添夜夜添亚洲女人| 亚洲一区二区成人在线观看| 国产精一区二区三区| 欧美伊人久久久久久久久影院| 91麻豆文化传媒在线观看| 久久综合色婷婷| 日韩精彩视频在线观看| 日本道免费精品一区二区三区| 99精品黄色片免费大全| 日韩免费看网站| 亚洲午夜一二三区视频| 99久久99精品久久久久久 | 国产精品66部| 欧美一二三四区在线| 一区二区三区视频在线看| 国产精品一级片| 精品对白一区国产伦| 日本特黄久久久高潮| 欧美精品日日鲁夜夜添| 亚洲精品免费电影| 91丝袜美腿高跟国产极品老师| 欧美在线你懂的| 亚洲精品中文在线影院| a在线欧美一区| 国产精品午夜免费| 国产成人免费在线视频| 久久久午夜电影| 国内偷窥港台综合视频在线播放| 国产一区二区免费看| 欧美一区二区三区视频在线观看| 欧美xxxxxxxxx| 日本亚洲免费观看| 91麻豆精品国产91久久久| 亚洲成a人片在线观看中文| 欧美色图免费看| 亚洲第一福利一区| 欧美亚洲综合另类| 亚洲一卡二卡三卡四卡五卡| 色综合天天性综合| 亚洲精品乱码久久久久久久久 | 婷婷综合另类小说色区| 91网址在线看| 亚洲一区二区三区美女| 精品视频一区二区不卡| 天堂va蜜桃一区二区三区漫画版| 国产一区二区免费在线| 337p粉嫩大胆噜噜噜噜噜91av| 亚洲色图丝袜美腿| 欧美专区日韩专区| 亚洲黄色免费电影| 欧美精品v国产精品v日韩精品| 国产欧美日韩不卡免费| 成人黄色av电影| 亚洲人成精品久久久久久| 在线一区二区三区| 免费高清不卡av| 久久久蜜臀国产一区二区| 成人永久aaa| 亚洲国产一二三| 日韩欧美国产成人一区二区| 国产一本一道久久香蕉| 日韩一区欧美小说| 69堂成人精品免费视频| 国产在线日韩欧美| 亚洲三级在线观看| 91精品国产黑色紧身裤美女| 国产一区二区在线免费观看|