Skip to Content
Mastering Python for Networking and Security
book

Mastering Python for Networking and Security

by José Manuel Ortega
September 2018
Intermediate to advanced
426 pages
10h 46m
English
Packt Publishing
Content preview from Mastering Python for Networking and Security

Chapter 3: Socket Programming

  1. Which method of the sockets module allows a domain name to be obtained from an IP address?

With the gethostbyaddr(address) method, we can obtain a domain name from an IP address.

  1. Which method of the socket module allows a server socket to accept requests from a client socket from another host?

socket.accept() is used to accept the connection from the client. This method returns two values: client_socket and client_address, where client_socket is a new socket object used to send and receive data over the connection.

  1. Which method of the socket module allows the sending of data to a given address?

socket.sendto(data, address) is used to send data to a given address.

  1. Which method of the socket module ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Python for Networking and Security - Second Edition

Mastering Python for Networking and Security - Second Edition

José Manuel Ortega
Python for Cybersecurity

Python for Cybersecurity

Howard E. Poston, III

Publisher Resources

ISBN: 9781788992510Supplemental Content