Rebol Smallest Http Server in the World: why first wait listen-port?

▼魔方 西西 提交于 2019-12-07 19:31:27

The wait on the listen-port blocks until a new client connects. Once that happens, it simply returns listen-port. The subsequent first then retrieves port corresponding to the newly connected client. After this, you have two distinct ports: listen-port, which is the port the server listens on for further connects, and http-port, which is the port for talking to the newly connected client.

The section "Creating TCP Servers" from the REBOL/Core Users Guide for version 2.3 is still perfectly up to date in those regards.

wait blocks until listen-port has activity, then returns listen-port.

Thus, first takes and returns the first line of data from listen-port.

The documentation explains (however briefly).

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!