You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for i in range(8):
for j in range(8):
chunk_id = i * 8 + j
left = j * chunk_width
upper = i * chunk_height
right = left + chunk_width
lower = upper + chunk_height
chunk_img = img.crop((left, upper, right, lower))
chunk_bytes = io.BytesIO()
chunk_img.save(chunk_bytes, format='JPEG', quality=quality)
# Compare with the previous chunk to detect changes
if prev_chunks.get(chunk_id) != chunk_bytes.getvalue():
prev_chunks[chunk_id] = chunk_bytes.getvalue() # Update the cached chunk
# Prepend chunk_id to the binary data
chunk_with_id = struct.pack('>I', chunk_id) + chunk_bytes.getvalue()
changed_chunks.append(chunk_with_id) #
# Send only changed chunks as binary
if changed_chunks:
print("sent")
for chunk in changed_chunks:
ws.send(chunk, opcode=0x2)
and there is no manipulation in php server, it just directly send to flutter when its received
the binary data is generated in python
and there is no manipulation in php server, it just directly send to flutter when its received
E/flutter (31979): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: SocketException: Reading from a closed socket
E/flutter (31979): #0 _RawSecureSocket.read (dart:io/secure_socket.dart:779:7)
E/flutter (31979): #1 _Socket._onData (dart:io-patch/socket_patch.dart:2448:28)
E/flutter (31979): #2 _RootZone.runUnaryGuarded (dart:async/zone.dart:1594:10)
E/flutter (31979): #3 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
E/flutter (31979): #4 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
E/flutter (31979): #5 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:784:19)
E/flutter (31979): #6 _StreamController._add (dart:async/stream_controller.dart:658:7)
E/flutter (31979): #7 _StreamController.add (dart:async/stream_controller.dart:606:5)
E/flutter (31979): #8 _RawSecureSocket._sendReadEvent (dart:io/secure_socket.dart:1116:19)
E/flutter (31979): #9 Timer._createTimer. (dart:async-patch/timer_patch.dart:18:15)
E/flutter (31979): #10 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398:19)
E/flutter (31979): #11 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429:5)
E/flutter (31979): #12 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
The text was updated successfully, but these errors were encountered: