I'm a total beginner and newb at all this programming stuff and I'm trying to learn as best as I can but I'm having issues. Can anyone explain Python networking? Where I'm getting confused is my book says:
"You can run several clients while the server is still running. By replacing the call to gethostname in the client with the actual host name of the machine where the server is running, you can have the two programs connect across a network from one machine to another."
I'm having trouble understanding the part with the asterisks surrounding it. I don't know what they mean by that.
#Client Code:
#!/usr/bin/env python
import socket
s = socket.socket()
host = socket.gethostname()
port = 1234
s.connect((host, port))
print s.recv(1024)
#Server code:
#!/usr/bin/env python
import socket
s = socket.socket()
host = socket.gethostname()
port = 1234
s.bind((host,port))
s.listen(5)
while True:
c, addr = s.accept()
print 'Got connection from', addr
c.send('Thank you for connecting')
c.close()
Here's the code that my book has but I don't really understand it.