2020-08-13 10:00:20 +00:00
|
|
|
---
|
|
|
|
id: 5ea9997bbec2e9bc47e94daf
|
2021-07-05 06:57:02 +00:00
|
|
|
title: 了解套接字并创建 TCP 服务器
|
2020-08-13 10:00:20 +00:00
|
|
|
challengeType: 11
|
|
|
|
videoId: F1QI9tNuDQg
|
2021-10-03 19:24:27 +00:00
|
|
|
bilibiliIds:
|
|
|
|
aid: 848005038
|
|
|
|
bvid: BV1bL4y1a7kJ
|
|
|
|
cid: 409034113
|
2021-01-13 02:31:00 +00:00
|
|
|
dashedName: understanding-sockets-and-creating-a-tcp-server
|
2020-08-13 10:00:20 +00:00
|
|
|
---
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
# --question--
|
|
|
|
|
|
|
|
## --text--
|
|
|
|
|
2021-07-05 06:57:02 +00:00
|
|
|
以下哪个函数创建套接字对象?
|
2020-12-16 07:37:30 +00:00
|
|
|
|
|
|
|
## --answers--
|
|
|
|
|
|
|
|
`socket.bind((host, port))`
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
`socket.gethostbyname()`
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
`socket.socket(socket.AF_INET, socket.SOCK_STREAM)`
|
|
|
|
|
|
|
|
## --video-solution--
|
|
|
|
|
|
|
|
3
|
|
|
|
|