Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 1 commit
  • 1 file changed
  • 0 comments
  • 1 contributor

Showing 1 changed file with 8 additions and 4 deletions. Show diff stats Hide diff stats

  1. 12  client.py
12  client.py
@@ -4,12 +4,16 @@
4 4
 class Client():
5 5
 	def __init__(self):
6 6
                 self.name = raw_input('Enter Name: ')
7  
-		self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
8  
-		self.s.connect((HOST, PORT))
9  
-		data = s.recv(1024)
10  
-		self.s.close()
  7
+                try: self.host = HOST
  8
+                except: self.host = raw_input('Enter Host\'s IP: ')
  9
+                self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  10
+                self.s.connect((self.host, PORT))
  11
+                data = s.recv(1024)
  12
+                self.s.close()
11 13
 		print repr(data)
12 14
 
13 15
 	def say(self, msg):
14 16
                 self.s.sendall(self.name + ': ' + msg)
15 17
                 
  18
+
  19
+        

No commit comments for this range

Something went wrong with that request. Please try again.