MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / PiuDebugMachineCallback

Function PiuDebugMachineCallback

tools/xsbug/DebugBehavior.c:541–568  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

539
540#if mxLinux
541gboolean PiuDebugMachineCallback(GSocket *socket, GIOCondition condition, gpointer user_data)
542{
543 PiuDebugMachine self = (PiuDebugMachine)user_data;
544 gssize length = g_socket_receive(self->socket, self->buffer, XS_BUFFER_COUNT, NULL, NULL);
545 if (length > 0) {
546 self->buffer[length] = 0;
547 //fprintf(stderr, "%s", self->buffer);
548 xsBeginHost(self->the);
549 {
550 xsVars(4);
551 PiuDebugMachineParse(self, self->buffer, length);
552
553 xsResult = xsGet(xsGlobal, xsID_application);
554 PiuApplication* application = PIU(Application, xsResult);
555 PiuApplicationAdjust(application);
556 }
557 xsEndHost();
558 }
559 else {
560 PiuDebugMachineDisconnect(self);
561 xsBeginHost(self->the);
562 {
563 (void)xsCall0(self->thisSlot, xsID_onDisconnected);
564 }
565 xsEndHost();
566 }
567 return TRUE;
568}
569#elif mxMacOSX
570void PiuDebugMachineCallback(CFSocketRef socketRef, CFSocketCallBackType cbType, CFDataRef addr, const void* data, void* context)
571{

Callers

nothing calls this directly

Calls 3

PiuDebugMachineParseFunction · 0.85
PiuApplicationAdjustFunction · 0.85

Tested by

no test coverage detected