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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tcp_receiver.c

?? 一款基于FPGA的對于VGA實現全彩控制的程序
?? 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;
	}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
激情图区综合网| 亚洲综合视频在线| 欧美久久高跟鞋激| 日本高清免费不卡视频| 一本大道久久a久久精品综合 | 日本高清不卡一区| 91无套直看片红桃| 在线视频国内自拍亚洲视频| 欧美日精品一区视频| 欧美久久久一区| 91精品欧美福利在线观看| 日韩亚洲欧美成人一区| 欧美va在线播放| 欧美韩国一区二区| 亚洲欧美自拍偷拍色图| 亚洲国产视频在线| 毛片av一区二区| 国产成人自拍高清视频在线免费播放| 国产成人免费在线| jiyouzz国产精品久久| 日韩一区二区三区免费观看| 日韩欧美一二区| 欧美激情在线看| 亚洲综合色成人| 乱中年女人伦av一区二区| 国产成人午夜高潮毛片| 91久久精品日日躁夜夜躁欧美| 欧美视频日韩视频在线观看| 日韩欧美国产一区二区在线播放| 久久久久久久久伊人| 亚洲激情图片一区| 久久www免费人成看片高清| 成人av电影在线网| 欧美三级韩国三级日本一级| 精品不卡在线视频| 成人免费在线视频| 麻豆精品一区二区| 一本色道久久综合狠狠躁的推荐 | 久久久蜜桃精品| 亚洲综合男人的天堂| 国产风韵犹存在线视精品| 欧美影院一区二区| 国产精品免费久久| 日本三级韩国三级欧美三级| 成人少妇影院yyyy| 日韩欧美你懂的| 亚洲尤物在线视频观看| 国产在线看一区| 欧美日韩精品三区| 最新不卡av在线| 国产精品一区二区黑丝| 欧美精品自拍偷拍| 一区二区三区中文字幕电影| 国产91在线看| 欧美电视剧免费观看| 一区二区三区四区视频精品免费| 欧美私人免费视频| 日本一区二区三区在线不卡| 免费在线观看一区| 制服丝袜国产精品| 亚洲电影一区二区三区| 91美女精品福利| 中文字幕在线不卡一区二区三区| 国产综合久久久久影院| 欧美一二三区在线观看| 欧美aaa在线| 欧美精品久久99| 一区二区三区日韩欧美| av不卡在线观看| 国产精品高清亚洲| 99久久精品国产一区| 国产视频不卡一区| 国产99一区视频免费| 久久日一线二线三线suv| 国产资源精品在线观看| 亚洲精品一区在线观看| 国内成人自拍视频| 久久日韩精品一区二区五区| 久久精品国产精品青草| 精品三级在线看| 国产精品影视在线观看| 国产午夜亚洲精品理论片色戒| 国产二区国产一区在线观看| 欧美激情一区二区三区四区| 顶级嫩模精品视频在线看| 欧美激情一区在线观看| 色悠悠亚洲一区二区| 亚洲高清中文字幕| 91精品一区二区三区久久久久久 | 国产精品国产三级国产aⅴ中文| 国产精品羞羞答答xxdd| 欧美国产精品一区二区三区| 高清不卡在线观看av| 亚洲柠檬福利资源导航| 欧美情侣在线播放| 国内精品久久久久影院一蜜桃| 国产精品视频第一区| 色婷婷综合久久久久中文一区二区| 亚洲综合免费观看高清完整版| 欧美日韩久久久一区| 国产乱子伦一区二区三区国色天香| 国产亚洲精久久久久久| 欧美伊人久久久久久午夜久久久久| 日韩av一级电影| 日本一区二区综合亚洲| 91久久线看在观草草青青 | 国产成人一级电影| 亚洲精品高清在线观看| 欧美一级片在线看| 成人精品视频一区二区三区 | 亚洲成av人片| 久久久久97国产精华液好用吗 | 亚洲精品成人天堂一二三| 欧美日韩成人激情| 国产999精品久久| 午夜精品爽啪视频| 国产午夜精品久久久久久久| 欧美日韩国产a| 懂色中文一区二区在线播放| 亚洲成人你懂的| 中文字幕视频一区| 日韩欧美一级在线播放| 色综合久久88色综合天天6| 极品少妇一区二区三区精品视频| 亚洲品质自拍视频网站| 久久亚洲欧美国产精品乐播| 欧美日韩不卡在线| 91麻豆.com| 成人综合在线视频| 裸体在线国模精品偷拍| 亚洲电影一级片| 中文字幕字幕中文在线中不卡视频| 精品久久人人做人人爰| 欧美日韩1区2区| 色88888久久久久久影院野外| 国产精品77777| 精品一区二区久久| 看电影不卡的网站| 亚洲大尺度视频在线观看| 亚洲激情在线播放| 国产精品盗摄一区二区三区| 精品少妇一区二区三区视频免付费 | 日本最新不卡在线| 亚洲午夜电影网| 伊人色综合久久天天人手人婷| 久久久久综合网| 日韩精品一区二区三区swag| 在线成人免费观看| 欧美另类z0zxhd电影| 色偷偷88欧美精品久久久| 北岛玲一区二区三区四区| 国产在线国偷精品免费看| 久久综合综合久久综合| 亚洲国产成人精品视频| 性做久久久久久免费观看| 亚洲国产精品一区二区www在线 | 免费成人av在线播放| 日韩国产精品久久久久久亚洲| 亚洲综合在线电影| 亚洲第一成年网| 亚洲综合一区在线| 亚洲高清不卡在线观看| 午夜精品久久久| 麻豆一区二区在线| 黑人精品欧美一区二区蜜桃| 国产露脸91国语对白| 国产成人高清在线| 色婷婷综合久久久久中文一区二区| 91高清视频免费看| 欧美高清精品3d| 欧美一三区三区四区免费在线看 | 91视视频在线观看入口直接观看www| av中文一区二区三区| 一本到一区二区三区| 91.xcao| 久久久久九九视频| 中文字幕在线一区免费| 亚洲国产成人91porn| 国内成人精品2018免费看| 99久久综合国产精品| 欧美日韩一区不卡| 久久美女高清视频| 一区二区三区四区乱视频| 美女视频网站久久| 99vv1com这只有精品| 91精品国产91综合久久蜜臀| 国产三级精品三级在线专区| 亚洲私人黄色宅男| 麻豆成人综合网| 91麻豆福利精品推荐| 亚洲精品在线一区二区| 亚洲久草在线视频| 国产一区二区三区av电影 | 偷拍亚洲欧洲综合| 国产乱码精品1区2区3区| 欧美日韩一区二区三区四区| 国产精品网站一区| 蜜臀久久久99精品久久久久久| 成人黄色小视频| 欧美va在线播放|