// === CODE ===
void AxWin3_Connect(const char *ServerDesc)
{
- _SysDebug("ServerDesc = %s", ServerDesc);
- if( !ServerDesc )
- {
+ _SysDebug("ServerDesc (argument) = %s", ServerDesc);
+ if( !ServerDesc ) {
ServerDesc = gsAxWin3_int_ServerDesc;
}
_SysDebug("ServerDesc = %s", ServerDesc);
case '6': case '7': case '8': case '9': case '0':
giConnectionType = CONNTYPE_SENDMESSAGE;
giConnectionNum = atoi(ServerDesc);
+ if( giConnectionNum == 0 ) {
+ _SysDebug("Invalid server PID");
+ exit(-1);
+ }
break;
case 'u':
while(*ServerDesc && *ServerDesc != ':') ServerDesc ++;
char tmpbuf[giAxWin3_int_UDPHeaderLen + size];
memcpy(tmpbuf, gaAxWin3_int_UDPHeader, giAxWin3_int_UDPHeaderLen);
memcpy(tmpbuf + giAxWin3_int_UDPHeaderLen, Msg, size);
- write(giConnectionNum, tmpbuf, sizeof(tmpbuf));
+ _SysWrite(giConnectionNum, tmpbuf, sizeof(tmpbuf));
}
break;
case CONNTYPE_TCP:
- write(giConnectionNum, Msg, size);
+ _SysWrite(giConnectionNum, Msg, size);
break;
default:
break;
{
int len;
tAxWin_IPCMessage *ret = NULL;
- pid_t tid;
+ int tid;
_SysSelect(nFD, fds, NULL, NULL, NULL, THREAD_EVENT_IPCMSG);