This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gyenoti
Recipients gyenoti
Date 2021-03-16.15:50:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Any idea why this doesnt work ?

import socket

HOST = ""
PORT = 8000 #initiate port no above 1024

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print('Socket created')

s.bind((HOST, PORT))  #bind host address and port together#
#except socket.error as e:
    #print('Bind failed.')
s.listen(10)  #configure how many clients the server can listen to simultaneously

print("Socket is Listening")
#conn, addr = s.accept()    #accept new connection
#print("connection from:" + str(addr))

while True:
    conn, addr = s.accept()    #accept new connection
    print("connection from:" + str(addr))
    data = conn.recv(1024).decode()  #receive data stream
    #if not data: #if data is not received break
           # break
    print("from Android App:" + str(data))
    data = input ('from Python Server:')
    conn.send(data.encode())  #send data to client
    conn.close()  #close the connection
Date User Action Args
2021-03-16 15:50:02gyenotisetrecipients: + gyenoti
2021-03-16 15:50:02gyenotisetmessageid: <>
2021-03-16 15:50:02gyenotilinkissue43516 messages
2021-03-16 15:50:01gyenoticreate