N lenline cfileclose csockclose gets new

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: r process can then con=nue the loop. (The client ­connected socket must be ordered to shutdown and close when the handler is done and returns to the parent.) An Example Socket ­Level Server 15 #!/usr/bin/env python # Simple Server (uses socket like a file) : adapted by AAAF from (c) John Goerzen # $ ./ # connect using 'telnet 51423' import socket host = '' port = 51423 # accept connections from anywhere # any port > 1024 s = socket.socket( # create a TCP/IP socket \ socket.AF_INET, # denotes IPv4 \ sock...
View Full Document

This document was uploaded on 02/10/2014.

Ask a homework question - tutors are online