Message388850
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 |
|
Date |
User |
Action |
Args |
2021-03-16 15:50:02 | gyenoti | set | recipients:
+ gyenoti |
2021-03-16 15:50:02 | gyenoti | set | messageid: <1615909802.06.0.398723617988.issue43516@roundup.psfhosted.org> |
2021-03-16 15:50:02 | gyenoti | link | issue43516 messages |
2021-03-16 15:50:01 | gyenoti | create | |
|