X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;ds=sidebyside;f=AcessNative%2Fld-acess_src%2Frequest.c;fp=AcessNative%2Fld-acess_src%2Frequest.c;h=b8a3239bb04c4f780841537577aa50d086c31ccc;hb=a6f11cb266052c58ae7e2d6d6e8abd34a9e93214;hp=8655377ea658e3f80276fd38073ec2b10978c7a0;hpb=fbdee4576c1abe0e817ed974c882bfec63eaa842;p=tpg%2Facess2.git diff --git a/AcessNative/ld-acess_src/request.c b/AcessNative/ld-acess_src/request.c index 8655377e..b8a3239b 100644 --- a/AcessNative/ld-acess_src/request.c +++ b/AcessNative/ld-acess_src/request.c @@ -89,7 +89,8 @@ int _InitSyscalls() #if USE_TCP if( connect(gSocket, (struct sockaddr *)&gSyscall_ServerAddr, sizeof(struct sockaddr_in)) < 0 ) { - fprintf(stderr, "Cannot connect to server (localhost:%i)\n", SERVER_PORT); + fprintf(stderr, "[ERROR -] Cannot connect to server (localhost:%i)\n", SERVER_PORT); + fprintf(stderr, "[ERROR -] ", giSyscall_ClientID); perror("_InitSyscalls"); #if __WIN32__ closesocket(gSocket); @@ -119,6 +120,7 @@ int _InitSyscalls() #if !USE_TCP // Ask server for a client ID + if( !giSyscall_ClientID ) { tRequestHeader req; int len; @@ -210,6 +212,7 @@ void SendData(void *Data, int Length) #endif if( len != Length ) { + fprintf(stderr, "[ERROR %i] ", giSyscall_ClientID); perror("SendData"); exit(-1); } @@ -236,12 +239,13 @@ int ReadData(void *Dest, int MaxLength, int Timeout) ret = select(gSocket+1, &fds, NULL, NULL, timeoutPtr); if( ret == -1 ) { + fprintf(stderr, "[ERROR %i] ", giSyscall_ClientID); perror("ReadData - select"); exit(-1); } if( !ret ) { - printf("Timeout reading from socket\n"); + printf("[ERROR %i] Timeout reading from socket\n", giSyscall_ClientID); return 0; // Timeout } @@ -252,6 +256,7 @@ int ReadData(void *Dest, int MaxLength, int Timeout) #endif if( ret < 0 ) { + fprintf(stderr, "[ERROR %i] ", giSyscall_ClientID); perror("ReadData"); exit(-1); }