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

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

?? gui_vnc_x_startserver.c

?? 圖像系統uc_GUI
?? C
字號:
/*
*********************************************************************************************************
*                                             uC/GUI V3.98
*                        Universal graphic software for embedded applications
*
*                       (c) Copyright 2002, Micrium Inc., Weston, FL
*                       (c) Copyright 2002, SEGGER Microcontroller Systeme GmbH
*
*              礐/GUI is protected by international copyright laws. Knowledge of the
*              source code may not be used to write a similar product. This file may
*              only be used in accordance with a license and should not be redistributed
*              in any way. We appreciate your understanding and fairness.
*
----------------------------------------------------------------------
File        : GUI_X_StartVNC
Purpose     : Starts the VNC server via TCP/IP
              This code works with embOS and the RTIP TCP/IP stack.
              However, it can be easily modified to work with
              different kernel and IP Stack
---------------------------END-OF-HEADER------------------------------
*/

#include <stdlib.h>

#include "RTIP.H"     /* RTIP API */
#include "SOCKET.H"   /* BSD socket interface */
#include "RTOS.H"     /* embOS header */
#include "GUI.h"
#include "GUI_X.h"
#include "GUI_VNC.h"
#include "HWC.h"      /* Hardware function prototypes */

/*********************************************************************
*
*       static data
*
**********************************************************************
*/

static GUI_VNC_CONTEXT _Context;
static OS_STACKPTR int _StackVNCServer[1000];             /* embOS Stack area of the server */
static OS_TASK         _VNCServer_TCB;                    /* embOS Task-control-block of the server */

/*********************************************************************
*
*       static const
*
**********************************************************************
*/
static const unsigned char   _IPLocal[4] = {192,168,1,254};     /* IP address of the system */
static const unsigned char   _IPMask[4] =  {255,255,0,0};       /* IP mask for the system   */

/*********************************************************************
*
*             Static functions
*
**********************************************************************
*/


/*********************************************************************
*
*       _Send
*
* Function description
*   This function is called indirectly by the server; it's address is passed to the actual
*   server code as function pointer. It is needed because the server is independent
*   of the TCP/IP stack implementation, so details for the TCP/IP stack can be placed here.
* Notes:
*   (1) This implementation is for EBS's RTIP stack.
*   (2) It switches between blocking and non-blocking mode; This is due to a weekness
*       of the RTIP stack: It tries to fill up the TCP-window before sending the
*       package; but since the socket normally blocks, no more data is send to the socket
*       until a time-out expires of about 200 ms. This would slow down communication
*       dramatically and can be avoided with the "trick" below; as long as there is enough
*       space in the TCP-window, we use non-blocking mode.
*/
static int _Send(const U8* buf, int len, void* pConnectionInfo) {
  unsigned long r;                             /* Needs to be unsigned long, because ioctlsocket takes a pointer to it */
  SOCKET socket;
  unsigned long zero = 0;

  socket = (SOCKET)pConnectionInfo;
  ioctlsocket (socket, FIONWRITE, &r);
  if (r > len) {
    unsigned long one  = 1;
    ioctlsocket (socket, FIONBIO, &one); /* nonblocking */
  }
  r = send(socket, (const char*)buf, len, 0);
  ioctlsocket (socket, FIONBIO, &zero); /* blocking */
  return r;
}

/*********************************************************************
*
*       _Recv
*
* Function description
*   This function is called indirectly by the server; it's address is passed to the actual
*   server code as function pointer. It is needed because the server is independent
*   of the TCP/IP stack implementation, so details for the TCP/IP stack can be placed here.
* Notes:
*   (1) This implementation is for EBS's RTIP stack, but it should work without modification
*       on most TCP/IP stacks.
*/
static int _Recv(U8* buf, int len, void* pConnectionInfo) {
  return recv((SOCKET)pConnectionInfo, (char*)buf, len, 0);
}

/*********************************************************************
*
*       _ServerTask
*
* Function description
*   This routine is the actual server task.
*   It executes some one-time init code, then runs in an ednless loop.
*   It therefor does not terminate.
*   In the endless loop it
*     - Waits for a conection from a client
*     - Runs the server code
*     - Closes the connection
*/
static void _ServerTask(void) {
  int s, sock;
  short Port;
  struct sockaddr_in addr_in;
  const int one = 1;

  /* Prepare socket (one time setup) */
  Port = 5900 + _Context.ServerIndex;                     /* Default port for VNC is is 590x, where x is the 0-based layer index */
  addr_in.sin_family      = AF_INET;
  addr_in.sin_port        = htons(Port);
  addr_in.sin_addr.s_addr = INADDR_ANY;
  s = socket(AF_INET, SOCK_STREAM, 0);
  if (s < 0) {
    return;                                               /* Error ... We are done with this task */
  }
  if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (const char *) &one, sizeof(one)) < 0) {
    closesocket(s);
    return;                                               /* Error ... We are done with this task */
  }
  if (bind(s, (struct sockaddr *)&addr_in, sizeof(addr_in))) {
    closesocket(s);
    return;                                               /* Error ... We are done with this task */
  }
  if (listen(s, 1)) {
    closesocket(s);
    return;                                               /* Error ... We are done with this task */
  }
  
  /* Endless loop. We run thru it once for every client connecting to us */
  while (1) {
    struct sockaddr addr;
    int addrlen;

    /* Wait for an incoming connection */
    addrlen = sizeof(addr);
    if ((sock = accept(s, &addr, &addrlen)) < 0) {
      return;                                             /* Error ... We are done with this task */
    }

    /* Disable Nagle's algorithm - improves performance (optional) */
    {
      const int zero = 0;
      setsockopt(sock, SOL_SOCKET, SO_NAGLE, (const char *) &zero, sizeof(zero));
    }
    /* Run the actual server */
    GUI_VNC_Process(&_Context, _Send, _Recv, (void*)sock);

    /* Close the connection */
    closesocket(sock);
  }
}

/*********************************************************************
*
*       Public code
*
**********************************************************************
*/

/*********************************************************************
*
*             GUI_VNC_X_StartServer
*
* Function description
*   To start the server, the following steps are executed
*   - Make sure the TCP-IP stack is up and running
*   - Init the server context and attach it to the layer
*   - Start the thread (task) which runs the VNC server
* Notes:
*   (1) The first part of the code initializes the TCP/IP stack. In a typical
*       application, this is not required, since the stack should have already been
*       initialized some other place.
*       This could be done in a different module. (TCPIP_AssertInit() ?)
*/
int GUI_VNC_X_StartServer(int LayerIndex, int ServerIndex) {
  /* Make sure the TCP/IP stack is initialized.  (1) */
  if (xn_rtip_init() != 0) {
    OS_SendString("GUI_VNC_X_StartServer: Init failed\n");
    return 1;                    /* Error */
  }
  {
    int interface;
    xn_bind_cs(0);                                        /* append interface to device table */
    interface = xn_interface_open_config(CS89X0_DEVICE, 0, (IOADDRESS)0x20000300,5,0);   /* open interface */
    if (interface < 0) {
      OS_SendString("GUI_VNC_X_StartServer: Can not open interface\n");
      return 1;                                           /* Error */
    }
    xn_set_ip(interface, (PFBYTE)&_IPLocal[0], (PFBYTE)&_IPMask[0]);      /* set IP address of interface */
    HW_EnableEthernetIRQ();                               /* Enable ethernet IRQ. Make sure it is done after xn_interface_open_config() */  
  }

  /* Init VNC context and attach to layer (so context is updated if the display-layer-contents change */
  GUI_VNC_AttachToLayer(&_Context, LayerIndex);
  _Context.ServerIndex = ServerIndex;

  /* Create task for VNC Server */
  OS_CREATETASK(&_VNCServer_TCB, "VNC Server", _ServerTask, 50, _StackVNCServer);
  return 0;                                               /* O.k., server has been started */
}
/*************************** End of file ****************************/

	 	 			 		    	 				 	  			   	 	 	 	 	 	  	  	      	   		 	 	 		  		  	 		 	  	  			     			       	   	 			  		    	 	     	 				  	 					 	 			   	  	  			 				 		 	 	 			     			 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕亚洲成人| 视频一区二区三区中文字幕| 欧美日精品一区视频| 国产美女在线观看一区| 亚洲丰满少妇videoshd| 一本到高清视频免费精品| 亚洲三级在线免费观看| 色综合天天综合狠狠| 蜜臀av性久久久久蜜臀aⅴ| 亚洲精品成人在线| 国产欧美精品区一区二区三区| 欧美疯狂性受xxxxx喷水图片| 99在线视频精品| 国产精品99久久久久久有的能看 | 亚洲色图欧洲色图婷婷| 91香蕉国产在线观看软件| 亚洲免费观看视频| 国产精品你懂的在线| 在线精品视频免费播放| 成人av在线观| 性做久久久久久久久| 精品久久久久久久久久久久久久久 | 水野朝阳av一区二区三区| 亚洲色图欧美激情| 91精品国产色综合久久不卡电影| 99麻豆久久久国产精品免费优播| 国产美女精品一区二区三区| 国产精品久久久久四虎| 久久久午夜精品理论片中文字幕| 成人一区二区三区中文字幕| 亚洲亚洲精品在线观看| 亚洲色图制服丝袜| 亚洲欧美在线高清| 亚洲欧洲性图库| 91精品国产综合久久久久| 国产成人综合在线观看| 亚洲成人av福利| 亚洲国产精品黑人久久久| 91成人在线免费观看| 精品亚洲国产成人av制服丝袜| 视频一区二区三区中文字幕| 天天亚洲美女在线视频| 国产精品沙发午睡系列990531| 欧美日韩午夜在线| 欧美二区在线观看| 成人av手机在线观看| 国产91丝袜在线18| 日产国产欧美视频一区精品| 日本中文字幕不卡| 久久99精品久久久久久动态图 | 亚洲视频在线一区二区| 中文字幕一区av| 樱花草国产18久久久久| 日韩高清不卡一区| 亚洲欧美国产高清| 国产欧美日本一区二区三区| 欧美精品日韩精品| 欧美zozo另类异族| 欧美区一区二区三区| 99久久综合色| 欧美日韩精品一区二区三区四区| 正在播放一区二区| 欧美主播一区二区三区| 制服丝袜亚洲播放| 欧洲精品在线观看| 欧美精品日日鲁夜夜添| 欧美视频一二三区| 一本色道久久加勒比精品| 欧美二区三区91| 欧美日韩精品一区视频| 精品成人一区二区| 亚洲色图欧洲色图| 亚洲欧洲99久久| 全部av―极品视觉盛宴亚洲| 韩国中文字幕2020精品| 美女网站在线免费欧美精品| 亚洲一区二区三区四区中文字幕| 天天色天天操综合| 国产凹凸在线观看一区二区| 激情久久五月天| 美国精品在线观看| av在线综合网| 成年人网站91| 91麻豆精品国产91久久久资源速度 | 精品一区免费av| 91麻豆自制传媒国产之光| 91精品黄色片免费大全| 国产精品不卡在线观看| 蜜臀av一区二区在线免费观看| 午夜精品福利一区二区三区av| 国产精品一区二区三区乱码| 国产精品99久久久久久宅男| 欧美午夜精品一区二区三区| 久久久综合视频| 午夜天堂影视香蕉久久| 丰满亚洲少妇av| 日韩三级伦理片妻子的秘密按摩| 国产精品久久久久桃色tv| 国产精品美女一区二区| 免费在线看成人av| 欧美性生活久久| 中文字幕+乱码+中文字幕一区| 日本不卡不码高清免费观看| 日本精品视频一区二区三区| 欧洲色大大久久| 欧美日韩国产区一| 国产精品一区一区三区| 亚洲一区二区三区精品在线| 亚洲精品成人悠悠色影视| 亚洲制服丝袜av| 成人污污视频在线观看| 日韩欧美一二三区| 偷拍亚洲欧洲综合| av不卡在线观看| 国产精品日日摸夜夜摸av| 亚洲乱码国产乱码精品精小说| 国产精品一区二区久激情瑜伽| 制服丝袜日韩国产| 国产视频一区二区三区在线观看| 亚洲成人三级小说| 欧美伊人精品成人久久综合97| 中文字幕第一页久久| 国产精品系列在线播放| 色婷婷久久久久swag精品 | 成人国产精品免费观看动漫| 26uuuu精品一区二区| 综合久久一区二区三区| 日韩精品一二三区| 欧美剧在线免费观看网站| 亚洲成人自拍一区| 国产精品一区二区久久不卡| 91麻豆精品国产| 国产精品欧美综合在线| 粉嫩一区二区三区在线看| 久久久久久一二三区| 亚洲国产人成综合网站| 欧美在线你懂得| 偷窥国产亚洲免费视频| 成人app在线| 精品国精品国产尤物美女| 日韩美女啊v在线免费观看| 色综合天天综合色综合av | 成人精品高清在线| 国产精品第13页| 秋霞电影一区二区| 欧美本精品男人aⅴ天堂| 国内成+人亚洲+欧美+综合在线| 精品sm捆绑视频| 成人性生交大片免费看在线播放| 欧美理论在线播放| 美女在线观看视频一区二区| 欧美在线免费视屏| 日韩精品亚洲专区| 精品国产乱码久久久久久蜜臀| 韩国av一区二区三区四区| 国产精品网站导航| 色视频成人在线观看免| 国产精品美女久久久久久久久久久 | 亚洲成人免费看| 日韩欧美激情四射| 国产成人亚洲综合a∨婷婷| 国产精品久久福利| 3751色影院一区二区三区| 亚洲精品视频在线观看免费| 国产成人午夜99999| 欧美r级在线观看| aaa国产一区| 丝瓜av网站精品一区二区| 久久综合丝袜日本网| 色婷婷久久久综合中文字幕 | 久久一区二区三区四区| 成人av资源网站| 国产欧美一区二区精品久导航 | 国产一区二区三区在线观看免费视频 | 国产精品1区2区| 亚洲精品老司机| 欧美一区二区精品| 五月综合激情网| 久久久久一区二区三区四区| av在线不卡观看免费观看| 午夜私人影院久久久久| 久久只精品国产| 色婷婷久久99综合精品jk白丝| 欧美精品一区二区三区很污很色的| 国产福利一区二区三区视频| 亚洲成人精品一区二区| 欧美日韩亚洲国产综合| 国产一区在线看| 亚洲一级在线观看| 欧美日韩欧美一区二区| 粉嫩13p一区二区三区| 中文字幕第一区| 成人网在线免费视频| 欧美aaaaa成人免费观看视频| 亚洲欧洲美洲综合色网| 色香蕉久久蜜桃| 性做久久久久久久久| 91精选在线观看| 韩国视频一区二区| 亚洲一卡二卡三卡四卡无卡久久 |