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 <1615909802.06.0.398723617988.issue43516@roundup.psfhosted.org>
In-reply-to
Content
Any idea why this doesnt work ?


import socket

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

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

#try:
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
History
Date User Action Args
2021-03-16 15:50:02gyenotisetrecipients: + gyenoti
2021-03-16 15:50:02gyenotisetmessageid: <1615909802.06.0.398723617988.issue43516@roundup.psfhosted.org>
2021-03-16 15:50:02gyenotilinkissue43516 messages
2021-03-16 15:50:01gyenoticreate