mirror of https://github.com/Askill/r_place.git
increased buffer sizes
This commit is contained in:
parent
2293f52d9f
commit
21e3de27df
|
|
@ -12,8 +12,8 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var upgrader = websocket.Upgrader{
|
var upgrader = websocket.Upgrader{
|
||||||
ReadBufferSize: 2048,
|
ReadBufferSize: 4096,
|
||||||
WriteBufferSize: 2048,
|
WriteBufferSize: 4096,
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
||||||
|
|
@ -51,14 +51,14 @@ async def client():
|
||||||
i+=1
|
i+=1
|
||||||
x = pixel(**json.loads(await websocket.recv()))
|
x = pixel(**json.loads(await websocket.recv()))
|
||||||
image[x.x][x.y] = ([y*255 for y in colors[x.color]])
|
image[x.x][x.y] = ([y*255 for y in colors[x.color]])
|
||||||
if i% 500 == 0:
|
#if i% 4000 == 0:
|
||||||
cv2.imshow("changes x", image)
|
# cv2.imshow("changes x", image)
|
||||||
cv2.waitKey(10) & 0XFF
|
# cv2.waitKey(10) & 0XFF
|
||||||
await websocket.send("1")
|
await websocket.send("1")
|
||||||
#print(i, x)
|
#print(i, x)
|
||||||
|
|
||||||
async def main():
|
async def main():
|
||||||
coros = [sender() for _ in range(100)]
|
coros = [sender() for _ in range(500)]
|
||||||
coros.append(client())
|
coros.append(client())
|
||||||
returns = await asyncio.gather(*coros)
|
returns = await asyncio.gather(*coros)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue