Chapter 10, Programming with Sockets

  1. 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 that's used to send and receive data over the connection.
  2. socket.sendto(data, address) is used to send data to a given address.
  3. The bind(IP,PORT) method allows you to associate a host and a port with a specific socket, for example, server.bind(("localhost", 9999)).
  4. The main difference between TCP and UDP is that UDP is not connection-oriented. This means that there is no guarantee that our packets will reach their destinations, and there is no error notification if a delivery fails.
  5. socket.connect_ex(address) is used for implementing port scanning with sockets.
  6. RawCap.exe.
  7. socket.socket (socket.AF_INET6, socket.SOCK_STREAM).
  8. There is a module called selectors.
  9. The connection is wrapped into SSL packets using our ssl_wrap_socket() function.
  10. By calling the getpeercert() method and comparing it with the returned hostname.