mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 03:44:55 +00:00 
			
		
		
		
	Merge socket howto fixes from 3.4.
This commit is contained in:
		
						commit
						7b2ecc40a9
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
					@ -180,7 +180,7 @@ righter than others).
 | 
				
			||||||
Assuming you don't want to end the connection, the simplest solution is a fixed
 | 
					Assuming you don't want to end the connection, the simplest solution is a fixed
 | 
				
			||||||
length message::
 | 
					length message::
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   class mysocket:
 | 
					   class MySocket:
 | 
				
			||||||
       """demonstration class only
 | 
					       """demonstration class only
 | 
				
			||||||
         - coded for clarity, not efficiency
 | 
					         - coded for clarity, not efficiency
 | 
				
			||||||
       """
 | 
					       """
 | 
				
			||||||
| 
						 | 
					@ -189,8 +189,8 @@ length message::
 | 
				
			||||||
           if sock is None:
 | 
					           if sock is None:
 | 
				
			||||||
               self.sock = socket.socket(
 | 
					               self.sock = socket.socket(
 | 
				
			||||||
                               socket.AF_INET, socket.SOCK_STREAM)
 | 
					                               socket.AF_INET, socket.SOCK_STREAM)
 | 
				
			||||||
               else:
 | 
					           else:
 | 
				
			||||||
                   self.sock = sock
 | 
					               self.sock = sock
 | 
				
			||||||
 | 
					
 | 
				
			||||||
       def connect(self, host, port):
 | 
					       def connect(self, host, port):
 | 
				
			||||||
           self.sock.connect((host, port))
 | 
					           self.sock.connect((host, port))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue