Commit 785c0c4
committed
PEP 748: create_connection and create_server instead of connect
The `connect()` function is poorly named server-side as it actually
`bind()` the socket. Server-side the function lacks a `family` parameter
to support IPv6 without a DNS lookup.
Actually all three `connect()`, `bind()` and `listen()` socket function
are pretty low-level. The high-level `create_connection` (for `connect`)
and `create_server` (for `bind()` + `listen()`) are more pythonic. Wrap
the latter and not the former, also to remove the need of a `listen()`
method on the created socket (which is useless client-side).1 parent 791d34e commit 785c0c4
1 file changed
Lines changed: 21 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
354 | | - | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
355 | 362 | | |
356 | 363 | | |
357 | 364 | | |
| |||
382 | 389 | | |
383 | 390 | | |
384 | 391 | | |
385 | | - | |
386 | | - | |
387 | | - | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
388 | 404 | | |
389 | 405 | | |
390 | 406 | | |
| |||
404 | 420 | | |
405 | 421 | | |
406 | 422 | | |
407 | | - | |
| 423 | + | |
408 | 424 | | |
409 | 425 | | |
410 | 426 | | |
| |||
458 | 474 | | |
459 | 475 | | |
460 | 476 | | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
468 | 477 | | |
469 | 478 | | |
470 | 479 | | |
| |||
0 commit comments