2020-08-13 10:00:20 +00:00
|
|
|
---
|
|
|
|
id: 5ea9997bbec2e9bc47e94db4
|
2021-02-06 04:42:36 +00:00
|
|
|
title: Developing a Port Scanner
|
2020-08-13 10:00:20 +00:00
|
|
|
challengeType: 11
|
|
|
|
videoId: z_qkqZS7KZ4
|
2021-01-13 02:31:00 +00:00
|
|
|
dashedName: developing-a-port-scanner
|
2020-08-13 10:00:20 +00:00
|
|
|
---
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
# --question--
|
2020-08-13 10:00:20 +00:00
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
## --text--
|
2020-08-13 10:00:20 +00:00
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
What is the main difference between the `.connect()` and `.connect_ex()` methods?
|
2020-08-13 10:00:20 +00:00
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
## --answers--
|
2020-08-13 10:00:20 +00:00
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
There is no difference between the two methods.
|
2020-08-13 10:00:20 +00:00
|
|
|
|
2020-12-16 07:37:30 +00: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
|
|
|
|
|