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

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

?? uip-doc.txt

?? 最新版的BCC, bcc-src-1.0.29c.rar,基于sparc平臺處理器leon2,leon3,v7,v8等系列的linux環(huán)境下交叉編譯工具
?? TXT
?? 第 1 頁 / 共 3 頁
字號:
\codevoid example4_init(void) {   u16_t ipaddr[2];   uip_ipaddr(ipaddr, 192,168,0,1);   uip_connect(ipaddr, HTONS(80));}void example4_app(void) {   if(uip_connected() || uip_rexmit()) {      uip_send("GET /file HTTP/1.0\r\nServer:192.186.0.1\r\n\r\n",               48);      return;   }   if(uip_newdata()) {      device_enqueue(uip_appdata, uip_datalen());      if(device_queue_full()) {         uip_stop();      }   }   if(uip_poll() && uip_stopped()) {      if(!device_queue_full()) {         uip_restart();      }   }}\endcodeWhen the connection has been established, an HTTP request is sent tothe server. Since this is the only data that is sent, the applicationknows that if it needs to retransmit any data, it is that request thatshould be retransmitted. It is therefore possible to combine these twoevents as is done in the example.When the application receives new data from the remote host, it sendsthis data to the device by using the function device_enqueue(). It isimportant to note that this example assumes that this function copiesthe data into its own buffers. The data in the uip_appdata buffer willbe overwritten by the next incoming packet.If the device's queue is full, the application stops the data from theremote host by calling the uIP function uip_stop(). The applicationcan then be sure that it will not receive any new data untiluip_restart() is called. The application polling event is used tocheck if the device's queue is no longer full and if so, the data flowis restarted with uip_restart().\subsection example5 A simple web serverThis example shows a very simple file server application that listensto two ports and uses the port number to determine which file tosend. If the files are properly formatted, this simple application canbe used as a web server with static pages. The implementation follows.\codestruct example5_state {   char *dataptr;   unsigned int dataleft;};void example5_init(void) {   uip_listen(HTONS(80));   uip_listen(HTONS(81));}void example5_app(void) {   struct example5_state *s;   s = (struct example5_state)uip_conn->appstate;      if(uip_connected()) {      switch(uip_conn->lport) {      case HTONS(80):         s->dataptr = data_port_80;         s->dataleft = datalen_port_80;         break;      case HTONS(81):         s->dataptr = data_port_81;         s->dataleft = datalen_port_81;         break;      }      uip_send(s->dataptr, s->dataleft);      return;         }   if(uip_acked()) {      if(s->dataleft < uip_mss()) {         uip_close();         return;      }      s->dataptr += uip_conn->len;      s->dataleft -= uip_conn->len;      uip_send(s->dataptr, s->dataleft);         }}\endcodeThe application state consists of a pointer to the data that should besent and the size of the data that is left to send. When a remote hostconnects to the application, the local port number is used todetermine which file to send. The first chunk of data is sent usinguip_send(). uIP makes sure that no more than MSS bytes of data isactually sent, even though s->dataleft may be larger than the MSS. The application is driven by incoming acknowledgments. When data hasbeen acknowledged, new data can be sent. If there is no more data tosend, the connection is closed using uip_close().\subsection example6 Structured application program designWhen writing larger programs using uIP it is useful to be able toutilize the uIP API in a structured way. The following exampleprovides a structured design that has showed itself to be useful forwriting larger protocol implementations than the previous examplesshowed here. The program is divided into an uIP event handler functionthat calls seven application handler functions that process new data,act on acknowledged data, send new data, deal with connectionestablishment or closure events and handle errors. The functions arecalled newdata(), acked(), senddata(), connected(), closed(),aborted(), and timedout(), and needs to be written specifically forthe protocol that is being implemented.The uIP event handler function is shown below.\codevoid example6_app(void) {  if(uip_aborted()) {    aborted();  }  if(uip_timedout()) {    timedout();  }  if(uip_closed()) {    closed();  }  if(uip_connected()) {    connected();  }  if(uip_acked()) {    acked();  }  if(uip_newdata()) {    newdata();  }  if(uip_rexmit() ||     uip_newdata() ||     uip_acked() ||     uip_connected() ||     uip_poll()) {    senddata();  }}\endcodeThe function starts with dealing with any error conditions that mighthave happened by checking if uip_aborted() or uip_timedout() aretrue. If so, the appropriate error function is called. Also, if theconnection has been closed, the closed() function is called to the itdeal with the event.Next, the function checks if the connection has just been establishedby checking if uip_connected() is true. The connected() function iscalled and is supposed to do whatever needs to be done when theconnection is established, such as intializing the application statefor the connection. Since it may be the case that data should be sentout, the senddata() function is called to deal with the outgoing data.The following very simple application serves as an example of how theapplication handler functions might look. This application simplywaits for any data to arrive on the connection, and responds to thedata by sending out the message "Hello world!". To illustrate how todevelop an application state machine, this message is sent in twoparts, first the "Hello" part and then the "world!" part.\code#define STATE_WAITING 0#define STATE_HELLO   1#define STATE_WORLD   2struct example6_state {  u8_t state;  char *textptr;  int  textlen;};static void aborted(void) {}static void timedout(void) {}static void closed(void) {}static void connected(void) {  struct example6_state *s = (struct example6_state *)uip_conn->appstate;  s->state   = STATE_WAITING;  s->textlen = 0;}static void newdata(void) {  struct example6_state *s = (struct example6_state *)uip_conn->appstate;  if(s->state == STATE_WAITING) {    s->state   = STATE_HELLO;    s->textptr = "Hello ";    s->textlen = 6;  }}static void acked(void) {  struct example6_state *s = (struct example6_state *)uip_conn->appstate;    s->textlen -= uip_conn->len;  s->textptr += uip_conn->len;  if(s->textlen == 0) {    switch(s->state) {    case STATE_HELLO:      s->state   = STATE_WORLD;      s->textptr = "world!\n";      s->textlen = 7;      break;    case STATE_WORLD:      uip_close();      break;    }  }}static void senddata(void) {  struct example6_state *s = (struct example6_state *)uip_conn->appstate;  if(s->textlen > 0) {    uip_send(s->textptr, s->textlen);  }}\endcodeThe application state consists of a "state" variable, a "textptr"pointer to a text message and the "textlen" length of the textmessage. The "state" variable can be either "STATE_WAITING", meaningthat the application is waiting for data to arrive from the network,"STATE_HELLO", in which the application is sending the "Hello" part ofthe message, or "STATE_WORLD", in which the application is sending the"world!" message. The application does not handle errors or connection closing events,and therefore the aborted(), timedout() and closed() functions areimplemented as empty functions.The connected() function will be called when a connection has beenestablished, and in this case sets the "state" variable to be"STATE_WAITING" and the "textlen" variable to be zero, indicating thatthere is no message to be sent out.When new data arrives from the network, the newdata() function will becalled by the event handler function. The newdata() function willcheck if the connection is in the "STATE_WAITING" state, and if soswitches to the "STATE_HELLO" state and registers a 6 byte long "Hello" message with the connection. This message will later be sent out bythe senddata() function.The acked() function is called whenever data that previously was senthas been acknowleged by the receiving host. This acked() functionfirst reduces the amount of data that is left to send, by subtractingthe length of the previously sent data (obtained from "uip_conn->len")from the "textlen" variable, and also adjusts the "textptr" pointeraccordingly. It then checks if the "textlen" variable now is zero,which indicates that all data now has been successfully received, andif so changes application state. If the application was in the"STATE_HELLO" state, it switches state to "STATE_WORLD" and sets up a7 byte "world!\n" message to be sent. If the application was in the"STATE_WORLD" state, it closes the connection.Finally, the senddata() function takes care of actually sending thedata that is to be sent. It is called by the event handler functionwhen new data has been received, when data has been acknowledged, whena new connection has been established, when the connection is polledbecause of inactivity, or when a retransmission should be made. Thepurpose of the senddata() function is to optionally format the datathat is to be sent, and to call the uip_send() function to actuallysend out the data. In this particular example, the function simplycalls uip_send() with the appropriate arguments if data is to be sent,after checking if data should be sent out or not as indicated by the"textlen" variable.It is important to note that the senddata() function never shouldaffect the application state; this should only be done in the acked()and newdata() functions.*//** @} *//**\defgroup exampleapps Example applications@{The uIP distribution contains a number of example applications thatcan be either used directory or studied when learning to developapplications for uIP.*//** @} */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩精品电影| 欧美成人欧美edvon| 玖玖九九国产精品| 国产精品国产三级国产aⅴ原创 | 免费看欧美美女黄的网站| 国产精品久久三| 日韩欧美亚洲一区二区| 99re热这里只有精品免费视频| 蜜桃视频第一区免费观看| 亚洲免费观看高清完整版在线观看熊| 日韩欧美国产三级电影视频| 色综合久久久久久久久久久| 国产一区二区伦理片| 偷拍一区二区三区四区| 亚洲男人天堂一区| 欧美国产一区二区在线观看| 欧美一级一级性生活免费录像| 在线视频欧美精品| 成人激情av网| 国产成人在线看| 国内外成人在线| 麻豆一区二区三| 综合激情成人伊人| 久久久99精品久久| 久久久精品tv| 精品美女一区二区三区| 日韩亚洲欧美成人一区| 欧美人体做爰大胆视频| 精品视频色一区| 欧美午夜在线一二页| 在线免费不卡视频| 欧美性一二三区| 91黄视频在线观看| 色诱视频网站一区| 色综合久久六月婷婷中文字幕| jlzzjlzz亚洲女人18| 成人高清在线视频| 成人晚上爱看视频| 成人黄色国产精品网站大全在线免费观看| 国产一区在线观看麻豆| 国内精品久久久久影院薰衣草| 美女视频黄 久久| 精品亚洲欧美一区| 国产精品中文有码| 丰满少妇久久久久久久| 成人高清av在线| 91亚洲精品乱码久久久久久蜜桃| av在线不卡电影| 一本色道久久综合狠狠躁的推荐 | 中文字幕一区在线观看视频| 国产精品美女视频| 国产精品久久久久婷婷二区次| 中文字幕欧美日韩一区| 亚洲免费观看高清完整版在线观看熊 | 欧美浪妇xxxx高跟鞋交| 91精品国产一区二区| 日韩欧美国产一二三区| 久久亚洲一级片| 国产精品乱人伦一区二区| 亚洲日本在线a| 日韩精品欧美成人高清一区二区| 免费观看30秒视频久久| 国产精品99久久久| 91小视频免费看| 欧美理论片在线| 久久老女人爱爱| 亚洲三级在线观看| 婷婷中文字幕综合| 国产在线精品视频| 97久久精品人人爽人人爽蜜臀| 欧美午夜精品免费| 久久久久9999亚洲精品| 亚洲六月丁香色婷婷综合久久 | 亚洲欧美一区二区在线观看| 亚洲免费三区一区二区| 蜜桃精品在线观看| 成人丝袜18视频在线观看| 欧美日韩不卡一区二区| 亚洲国产成人自拍| 天天操天天干天天综合网| 国产一区二区三区四| 91蝌蚪国产九色| 日韩欧美国产麻豆| 亚洲欧美国产高清| 久草在线在线精品观看| 色欲综合视频天天天| 精品国产制服丝袜高跟| 亚洲综合成人网| 国产麻豆成人精品| 欧美日韩色综合| 国产午夜精品久久久久久免费视| 亚洲一区在线观看视频| 国产高清在线精品| 欧美精品在欧美一区二区少妇| 国产精品乱人伦| 麻豆国产欧美日韩综合精品二区| 色综合天天天天做夜夜夜夜做| 日韩欧美一级精品久久| 亚洲另类在线一区| 国产在线精品一区二区不卡了| 欧美男同性恋视频网站| **性色生活片久久毛片| 六月婷婷色综合| 在线观看视频一区二区| 国内精品免费在线观看| 欧美精品粉嫩高潮一区二区| 国产精品久久毛片| 激情深爱一区二区| 欧美日本在线播放| 亚洲六月丁香色婷婷综合久久 | 国产成人午夜视频| 欧美一区二区三区四区高清| 一区二区三区在线播| 成人免费的视频| 精品久久国产字幕高潮| 日本欧美在线观看| 色94色欧美sute亚洲13| 亚洲日本青草视频在线怡红院| 国产精品一区一区三区| 精品国产1区二区| 免费高清在线一区| 欧美日韩精品一区二区| 亚洲一卡二卡三卡四卡无卡久久| 成人av在线一区二区三区| 久久精品无码一区二区三区| 狠狠色伊人亚洲综合成人| 日韩一区二区三免费高清| 午夜视黄欧洲亚洲| 欧美久久久久久蜜桃| 亚洲成人激情自拍| 欧美人牲a欧美精品| 亚洲午夜激情网页| 欧美视频日韩视频在线观看| 亚洲综合丁香婷婷六月香| 91久久免费观看| 亚洲男人天堂av网| 在线免费观看日本欧美| 亚洲一区二区三区影院| 欧美主播一区二区三区| 亚洲成av人片在线| 欧美日高清视频| 麻豆精品新av中文字幕| 日韩免费观看高清完整版| 激情小说欧美图片| 久久久久久久精| 国产精品一区二区男女羞羞无遮挡 | 亚洲国产精品精华液ab| 成人免费av在线| 亚洲人成网站影音先锋播放| 色噜噜偷拍精品综合在线| 亚洲自拍欧美精品| 欧美一区二区三区四区在线观看| 久久精品国产在热久久| 久久久不卡影院| 色综合咪咪久久| 肉肉av福利一精品导航| 久久久久久久久久久久久女国产乱| 福利一区二区在线| 亚洲精选视频在线| 欧美日高清视频| 国产伦精品一区二区三区视频青涩 | 成人开心网精品视频| 亚洲乱码国产乱码精品精98午夜| 欧美日精品一区视频| 免费观看久久久4p| 国产欧美精品在线观看| 在线观看一区二区精品视频| 蜜臀精品久久久久久蜜臀| 日本一区二区视频在线| 欧洲另类一二三四区| 美女在线视频一区| 国产精品伦理在线| 欧美电影一区二区三区| 国产精品99久| 亚洲国产精品久久人人爱| 精品国产一区二区三区不卡| av在线一区二区三区| 日本欧美大码aⅴ在线播放| 国产偷国产偷亚洲高清人白洁| 色妞www精品视频| 麻豆精品一区二区| 亚洲丝袜美腿综合| 日韩欧美区一区二| 91色porny在线视频| 激情综合网av| 一区二区三区精品在线| 日韩视频一区二区在线观看| 91美女视频网站| 精品无码三级在线观看视频| 亚洲婷婷国产精品电影人久久| 日韩欧美一区电影| 在线视频欧美精品| 久久久.com| 91精品国产高清一区二区三区蜜臀| 粉嫩蜜臀av国产精品网站| 天堂一区二区在线| 亚洲男人天堂av网| 久久久精品免费网站| 日韩视频一区二区三区在线播放| 91亚洲大成网污www|