{
  "schemaVersion": "0.11.0",
  "canonical": "https://www.pystone.net/notes/uwa-answer-socket-select-optimization/",
  "atlas": "https://www.pystone.net/?node=uwa-answer-socket-select-optimization#knowledge-atlas",
  "markdown": "https://www.pystone.net/notes/uwa-answer-socket-select-optimization.md",
  "context": "https://www.pystone.net/notes/uwa-answer-socket-select-optimization.context.json",
  "knowledgeVersion": "224c990773de.5fa8af6e39fa",
  "build": {
    "siteCommit": "224c990773de166d23a886306577dd90379529ce",
    "notesCommit": "5fa8af6e39fa3891d1b9b4832bfa6c4e0ecaaf0a",
    "builtAt": "1970-01-01T00:00:00.000Z",
    "version": "224c990773de.5fa8af6e39fa"
  },
  "id": "note:uwa-answer-socket-select-optimization",
  "slug": "uwa-answer-socket-select-optimization",
  "title": "Socket.Select的优化方法",
  "type": "note",
  "visibility": "public",
  "idStability": "rename-stable",
  "author": {
    "name": "石心.Yong"
  },
  "publisher": {
    "name": "Perrin Yong",
    "profile": "https://www.pystone.net/profile/"
  },
  "aliases": [],
  "summary": "Socket.Select的优化方法",
  "contentRole": "source",
  "sourceType": "source",
  "sourceMetadata": {
    "author": "石心.Yong"
  },
  "isMoc": false,
  "mocRecognition": "none",
  "generated": false,
  "attribution": "external_source",
  "domain": "10-计算机、信息技术与工程",
  "tags": [],
  "mocs": [],
  "contentHash": "d3d84e90408b1d6b9b140977230173eca88a429f7e1d5f4fd642381b63e3a31e",
  "assets": [
    {
      "reference": "assets/60bf9405608bed3338d78796/01.png",
      "url": "/media/fd1455ed7c57c53fb50a.png",
      "mediaType": "image/png",
      "contentHash": "fd1455ed7c57c53fb50a3e5ca15271a48ef62222dcac1fcfc621333e38574252",
      "byteLength": 46869,
      "width": 1589,
      "height": 463
    }
  ],
  "headings": [
    {
      "depth": 1,
      "text": "Socket.Select的优化方法",
      "anchor": "socketselect的优化方法",
      "citation": "https://www.pystone.net/notes/uwa-answer-socket-select-optimization/#socketselect%E7%9A%84%E4%BC%98%E5%8C%96%E6%96%B9%E6%B3%95"
    },
    {
      "depth": 2,
      "text": "问题",
      "anchor": "问题",
      "citation": "https://www.pystone.net/notes/uwa-answer-socket-select-optimization/#%E9%97%AE%E9%A2%98"
    },
    {
      "depth": 2,
      "text": "我的回答",
      "anchor": "我的回答",
      "citation": "https://www.pystone.net/notes/uwa-answer-socket-select-optimization/#%E6%88%91%E7%9A%84%E5%9B%9E%E7%AD%94"
    },
    {
      "depth": 2,
      "text": "来源与关系",
      "anchor": "来源与关系",
      "citation": "https://www.pystone.net/notes/uwa-answer-socket-select-optimization/#%E6%9D%A5%E6%BA%90%E4%B8%8E%E5%85%B3%E7%B3%BB"
    }
  ],
  "claims": [],
  "outgoing": [
    {
      "id": "note:my-uwa-answers",
      "title": "我的 UWA 问答",
      "url": "https://www.pystone.net/notes/my-uwa-answers/",
      "atlas": "https://www.pystone.net/?node=my-uwa-answers#knowledge-atlas",
      "label": "我的 UWA 问答",
      "origin": "explicit",
      "humanReviewed": true,
      "context": "上位集合：我的 UWA 问答",
      "citation": "https://www.pystone.net/notes/uwa-answer-socket-select-optimization/#%E6%9D%A5%E6%BA%90%E4%B8%8E%E5%85%B3%E7%B3%BB"
    }
  ],
  "incoming": [
    {
      "id": "note:my-uwa-answers",
      "title": "我的 UWA 问答",
      "url": "https://www.pystone.net/notes/my-uwa-answers/",
      "atlas": "https://www.pystone.net/?node=my-uwa-answers#knowledge-atlas",
      "label": "我的 UWA 问答",
      "origin": "explicit",
      "humanReviewed": true,
      "context": "2021-06-09：Socket.Select的优化方法（内存管理、引擎技术）",
      "citation": "https://www.pystone.net/notes/my-uwa-answers/#2021"
    },
    {
      "id": "note:game-graphics-and-runtime",
      "title": "游戏图形与运行时",
      "url": "https://www.pystone.net/notes/game-graphics-and-runtime/",
      "atlas": "https://www.pystone.net/?node=game-graphics-and-runtime#knowledge-atlas",
      "label": "游戏图形与运行时",
      "origin": "explicit",
      "humanReviewed": true,
      "context": "我的UWA问答中的“2021-06-09 - Socket.Select的优化方法”导航项",
      "citation": "https://www.pystone.net/notes/game-graphics-and-runtime/#%E6%88%91%E7%9A%84uwa%E9%97%AE%E7%AD%94"
    }
  ],
  "contentMarkdown": "# Socket.Select的优化方法\n\n> [!note] 我的 UWA 问答\n> 本文收录我在 UWA 问答发表的公开回答。问题内容归原提问者；回答保留当时语境，技术结论可能受 Unity 版本、平台和项目条件限制。\n\n## 问题\n\n![image.png](assets/60bf9405608bed3338d78796/01.png)\n\n麻烦问下大家，系统调用这么高的原因是什么？一般有什么优化方法么\n\n- 提问者：小鹿乱撞\n- 提问时间：2021-06-09 08:00:05\n\n## 我的回答\n\nSocket.Select这个函数是用来监听多个端口上Socket的连接状态的，一般用于服务器，并且不常用。时间空间开销都比较大。首先是看客户端是否有必要同时监听多个端口的状态。如果确实需要，也有其他方法可以替代，比如使用常用的Socket API，使用多线程，每个Thread监听一个端口的情况。\n\n- 回答时间：2021-06-09 19:20:45\n- 最后更新：2021-06-09 22:23:01\n- 采纳状态：未采纳\n\n## 来源与关系\n\n- 上位集合：[[10-计算机、信息技术与工程/05-游戏图形与运行时/我的UWA问答/我的UWA问答|我的 UWA 问答]]\n- UWA 标签：内存管理、引擎技术\n- 原始问题：[Socket.Select的优化方法](https://answer.uwa4d.com/question/60bf9405608bed3338d78796)\n- 源页最后更新：2021-06-09 19:20:45\n"
}
