0

Hi guys i cant figure out why socket server sends me second message with the third one at the same time. However I want to get message one by one not together at the same time. How can i do this? Server code:

import socket

host = socket.gethostbyname(socket.gethostname())
port = 5000
ADDR = (host, port) 
s = socket.socket(socket.AF_INET,
                  socket.SOCK_STREAM)
s.bind(ADDR)
s.listen()
c, addr = s.accept()  
c.send(b'7:S ACK:4,')
c.send(b'11:S END:kSfdy,')
c.send(b'8:S 120794,')

Client code:

import socket

HOST = '192.168.1.54'  # The server's hostname or IP address
PORT = 5000
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
print(s.recv(1024))
print(s.recv(1024))
print(s.recv(1024))    #empty message
GGGGGG
  • 5
  • 4

0 Answers0