⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 design

📁 一个C编写网络广播的程序
💻
字号:
0) Concepts - Server sideStage 0: Startup   * Await connections (tcp)    + Send initialization data (mcast params)   * Wait for specified number of clientsStage 1: Init block   * Read data from input    * Send block header to clients    * All clients reply with CLIENT_READYStage 2: Data transmission   * Server sends ROUND packets of data (eg. 1024*1500 bytes)   * Send END_OF_DATA ('!') through TCP   * Clients send (tcp) : confirmations (CLIENT_START)                         : requests for retransmission (CLIENT_REQ) Stage 3: Finishing block   + TCP Servers handle requests    * Wait for all confirmations   * Goto 1 if more data. 1) Network schematics:            ______TCP___________________,           /                     /-> client       [SERWER]====>Multicast===<--> client<-,        \ \                      \-> client  |          \ ~~~~~~~~~~TCP~~~~~~~~~~~~~~~^    /          ~~~~~~~~~~~TCP~~~~~~~~~~~~~~~~~~~~TCP -> synchronisationMulticast -> data2) Modules - server         (input)         (tcp)             mdist: splits input into parts         |              |               awaits for clients       [data]       [control]           serves data         !              |                      mdist<========>mdtcp-srv         mcast-srv: transfers data         |              |               through multicast sockets         !              !                    mcast-srv        (tcp)             mdtcp-srv: handles confirmations and         |                              retransmissions - i.e. keeps       [blocks]                          transmission synced.         !      (mcast)      mcast-srv and mdtcp-srv are running as separate threads. This enables doing 'live' transmissions, with clients connecting at run-time and so on.(Well, this requires a bit of work, at least for now).There may be limitless tcp servers. They act concurrently, synchronizingonly between blocks. 3) client modules      (mcast)         (tcp)             client communicates through         |              |               tcp & multicast udp ,          !              !               mdist takes care of buffering         >===>client<===<               and joining the block together.         |              |               Single thread.       mdist            |         !              !       (output)        (tcp)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -