Skip to content

Instantly share code, notes, and snippets.

@Jiang-Xuan
Created February 24, 2018 09:29
Show Gist options
  • Save Jiang-Xuan/3cab9be3d304610ae18701f1a0511cc5 to your computer and use it in GitHub Desktop.
Save Jiang-Xuan/3cab9be3d304610ae18701f1a0511cc5 to your computer and use it in GitHub Desktop.

Revisions

  1. Jiang-Xuan revised this gist Feb 24, 2018. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion block-and-non-blocking-socket.md
    Original file line number Diff line number Diff line change
    @@ -2,4 +2,6 @@

    如果 I/O 操作没有完成, 会返回错误码 ERRNO EWOULDBLOCK.

    调用程序应该用 SELECT() 测试完整性, 对任何 socket 调用返回 EWOULDBLOCK
    调用程序应该用 SELECT() 测试完整性, 对任何 socket 调用返回 EWOULDBLOCK

    Reference from https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.hala001/orgblockasyn.htm.
  2. Jiang-Xuan created this gist Feb 24, 2018.
    5 changes: 5 additions & 0 deletions block-and-non-blocking-socket.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    如果一个 socket 文件被 FCNTL() or IOCTL() calls 设置为非阻塞, 调用的程序会继续运行即便 I/O 操作有可能还没有完成.

    如果 I/O 操作没有完成, 会返回错误码 ERRNO EWOULDBLOCK.

    调用程序应该用 SELECT() 测试完整性, 对任何 socket 调用返回 EWOULDBLOCK