2020-04-29 20:41:51 -04:00
|
|
|
---
|
|
|
|
id: 5ea9997bbec2e9bc47e94db4
|
|
|
|
title: Developing a Port Scanner
|
|
|
|
challengeType: 11
|
|
|
|
videoId: z_qkqZS7KZ4
|
2021-10-01 12:24:12 +08:00
|
|
|
bilibiliIds:
|
|
|
|
aid: 208077317
|
|
|
|
bvid: BV1Uh411p7HS
|
|
|
|
cid: 409036706
|
2021-01-13 03:31:00 +01:00
|
|
|
dashedName: developing-a-port-scanner
|
2020-04-29 20:41:51 -04:00
|
|
|
---
|
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
# --question--
|
2020-08-04 20:56:41 +01:00
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
## --text--
|
2020-04-29 20:41:51 -04:00
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
What is the main difference between the `.connect()` and `.connect_ex()` methods?
|
2020-08-04 20:56:41 +01:00
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
## --answers--
|
2020-04-29 20:41:51 -04:00
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
There is no difference between the two methods.
|
2020-05-28 22:40:36 +09:00
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
---
|
|
|
|
|
|
|
|
If there is an error or if no host is found, `.connect()` returns an error code while `.connect_ex()` raises an exception.
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
If there is an error or if no host is found, `.connect()` raises an exception while `.connect_ex()` returns an error code.
|
|
|
|
|
|
|
|
## --video-solution--
|
|
|
|
|
|
|
|
3
|
2020-04-29 20:41:51 -04:00
|
|
|
|