-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changing IP from localhost to that of the machine in the network #4
base: master
Are you sure you want to change the base?
Conversation
Changed IP to that of machine in network so that the code can work on multiple systems.
Changed IP to that of machine in network so that the code can work on multiple systems.
@@ -3,8 +3,8 @@ import select | |||
import sys | |||
|
|||
class Server: | |||
def __init__(self): | |||
self.host = '' | |||
def __init__(self, ip): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to make changes here. ~py
files are just the swaps. I think .gitignore
is not working
@@ -217,9 +217,18 @@ def fileno(self): | |||
def send(self, data): | |||
self.socket.send(data) | |||
|
|||
class IP_add: | |||
def getIP(self): | |||
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation is not correct at the start of s
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean s = socket.socket
's start? I think the indentation is okay. It runs without any error.
# Create our server instance | ||
s = Server() | ||
s = Server(ss.getIP()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice Work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please correct the required changes.
As the chat clients are intended to run on different systems, so the server would've to run on its machine's IP. Though I've changed the backup file as well (.py~), it could be deleted too.