1 / 5

Socket Programming in Python

Socket Programming in Python. Lloyd Jones. Sockets in Python. Great for cross-platform communication Fast form of IPC Can use send/ recv or read/write Bind, Listen, Accept Connections, Close. Explanation. Line 10: Create a server socket

Download Presentation

Socket Programming in Python

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Socket Programming in Python Lloyd Jones

  2. Sockets in Python • Great for cross-platform communication • Fast form of IPC • Can use send/recv or read/write • Bind, Listen, Accept Connections, Close

  3. Explanation • Line 10: Create a server socket • Line 11: Bind the socket to any address that the machine has using the specified port • Line 12: Begin listening on the socket, queue up “backlog” number of requests (5 in this case) • Lines 13-23: Main loop. Accepts connection reads in up to 1024 bytes. If data sent = “letmein”, then print a welcome message.

  4. Demo

More Related