0

Im using python socket to connect two computers,

it completely works when both systems are connected to one mobile hotspots or LAN, But when i use two diffrent hotspots or try to connect to my friend's PC, it stops working and client cant find server.

(I find my IP using "ipconfig" command on cmd from "Wireless LAN adapter Wi-Fi: IPV4 Adress") here are my codes for checking the connection:

#SERVER

import socket
s = socket.socket()
IP, port= MY IP, 8002
s.bind((IP,port))
while 1:
    s.listen(1)
    a,b=s.accept()
    print(a,b)
    print("client tried to connect")
#Client
import socket
s=socket.socket()
IP,port=SERVERS IP, 8002
s.connect((IP,port))

Can you guys help me please?

AmirAbbas
  • 1
  • 1

0 Answers0