- pid_t tid;
- len = SysGetMessage(&tid, NULL);
- // Check if the message came from the server
- if(tid != giConnectionNum)
+ _SysDebug("%i byte message from %i", len, tid);
+ // If not, pass the buck (or ignore)
+ if( gAxWin3_MessageCallback )
+ gAxWin3_MessageCallback(tid, len);
+ else
+ _SysGetMessage(NULL, 0, GETMSG_IGNORE);
+ continue ;
+ }
+
+ // Using CONNTYPE_SENDMESSAGE and server message has arrived
+ ret = malloc(len);
+ if(ret == NULL) {
+ _SysDebug("malloc() failed, ignoring message");
+ _SysGetMessage(NULL, 0, GETMSG_IGNORE);
+ return NULL;
+ }
+ _SysGetMessage(NULL, len, ret);
+ break;
+ }
+
+ if( giConnectionType != CONNTYPE_SENDMESSAGE )
+ {
+ if( FD_ISSET(giConnectionNum, fds) )
+ {
+ char tmpbuf[STATICBUF_SIZE];
+ char *data = tmpbuf;
+ size_t len = _SysRead(giConnectionNum, tmpbuf, sizeof(tmpbuf));
+
+ if( giConnectionType == CONNTYPE_UDP )