On Mon, 21 Dec 2009 12:10:01 -0600 shawn bright <neph...@gmail.com> wrote:
> Hey all, Hi... > > I keep getting a connection error 111 connection refused. When i try > to connect to a server at a remote ip address. The keywords here: "connection refused" and "remote ip address". > > I am using linux on both computers. > > the socket server looks like this: > #!/usr/bin/python > import SocketServer > > class MyTCPHandler(SocketServer.BaseRequestHandler): > > def handle(self): > self.data = self.request.recv(1024).strip() > print "%s wrote:" % self.client_address[0] > print self.data > # just send back the same data, but upper-cased > self.request.send(self.data.upper()) > > if __name__ == "__main__": > HOST, PORT = "127.0.0.1", 3000 The server won't accept _any_ connections not coming from "127.0.0.1"! You want it to accept connection from _anywhere_ use: "0.0.0.0". ----8<---- > > it does work if i use localhost and run both server and client on the > same computer. As expected. > > any tips would be greatly appreciated, > thanks > > sk Hope that helps Ziyad. _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor