Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
581 B
2
Indexable
Never
import socket              
import numpy as np

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
data = []
host = socket.gethostname() 
port = 8080          
s.bind(("192.168.0.101", port))    
count = 0
s.listen()   
while True:
   c, addr = s.accept()   
   print('Got connection from', addr)
   if(addr != None):
      while True:
         count+=1
         d = c.recv(5120*4);
         #data = np.append(data, )
         buffer = np.frombuffer(d, dtype=np.float32)
         print(buffer)
         print(count)
         #print(c.recv(1024))
         #break       
c.close()