I have simple programs for the socket client and server, which it does not work over the Internet
import socket
import ImageGrab
HOST = ''
PORT = 3000
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((HOST, PORT))
s.listen(1)
conn, addr = s.accept()
print 'Connected by', addr
data = conn.recv(1024)
print data
conn.close()
import socket
import ImageGrab
HOST = '127.0.0.1'
PORT = 3000
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
s.send('Hello rushikesh')
s.close()
print 'Received'
When we try to get it to work over the Internet, it cannot connect. The program is shown as above, only the ip destination replaces my ip friends.
When working on localhost, it works fine, but does not work over the Internet ...
I wrote a program using SOCK_DGRAM, it works over the Internet only for small pieces of data. I want to transfer an image using it, so I wrote it with the help SOCK_STREAMof an image transfer that worked successfully on the local host and did not work over the Internet. So I wrote a simple program, but still showing the same problem
Can someone please check me out through this ...