Socket methods

These are the general socket methods we can use in both clients and servers:

  • socket.recv(buflen): This method receives data from the socket. The method argument indicates the maximum amount of data it can receive.
  • socket.recvfrom(buflen): This method receives data and the sender's address.
  • socket.recv_into(buffer): This method receives data into a buffer.
  • socket.recvfrom_into(buffer): This method receives data into a buffer.
  • socket.send(bytes): This method sends bytes data to the specified target.
  • socket.sendto(data, address): This method sends data to a given address.
  • socket.sendall(data): This method sends all the data in the buffer to the socket.
  • socket.close(): This method releases the memory and finishes the connection.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.48.204