2

I have a dynamic ip address, and I need my client to connect to my server even if my ip address changed.

I port forwarded my port and using the duc of No-ip.org.

Is it possible to connect if I declare my host like this?

def socket_create():
    try:
        global host
        global port
        global s
        host = 'testnoiphost.ddns.net'
        port = 9999
        s = socket.socket()
    except socket.error as msg:
        print("Socket creation error: " + str(msg))
Januka samaranyake
  • 2,385
  • 1
  • 28
  • 50
LoKi
  • 21
  • 2
  • 4
    Please avoid linking an image of your code instead of using the code tags [Markdown help](http://stackoverflow.com/editing-help). Questions like "is it possible if.." are also generally not well-formed. I'd advise reading this: [How do I ask a good question](http://stackoverflow.com/help/how-to-ask) – CmdrSharp Nov 05 '16 at 05:39
  • Is this address bound to an interface on the system? – Ignacio Vazquez-Abrams Nov 05 '16 at 06:15
  • 1
    It's not very clear what you're asking. The code you've shown doesn't make any attempt to connect to anything, it just creates a socket that doesn't attach to anything. Call `s.connect()` with appropriate arguments (e.g. the 2-tuple `(host, port)`) and maybe you'll get somewhere. If that's not what you're asking about, you'll need to explain more so we understand what your issue is. – Blckknght Nov 05 '16 at 10:17

0 Answers0