void doprocessing (int sock) { int n; char s1[256]; char buffer[256]; memset(&(buffer), '0', 256); int recvMsgSize; if ((recvMsgSize = recv(sock, buffer, 256, 0)) < 0) //Receive message from client perror("ERROR1 reading to socket "); /* Send received string and receive again until end of transmission */ while (recvMsgSize > 0) /* zero indicates end of transmission */ { if (send(sock, buffer, recvMsgSize, 0) != recvMsgSize) // Echo message back to client perror("ERROR2 writing to socket"); //LLAMADAs s1[] = buffer.Substring(2, 5); printf("String %s",s1[]); findRFC(buffer); if ((recvMsgSize = recv(sock, buffer, 256, 0)) < 0) //See if there is more data to receive perror("ERROR3 reading to socket "); } closesocket(sock); /* Close client socket */ }
void prueba(char b[]) { char blocal[256]; strcpy(blocal,b); printf("%s",blocal); if(findRFC(blocal)==1) { printf("no existe"); } else { //findRFC(b); } }
void doprocessing (int sock) { int n; char buffer[256]; char s1[256]; memset(&(buffer), '0', 256); int recvMsgSize; /* Receive message from client */ if ((recvMsgSize = recv(sock, buffer, 256, 0)) < 0) perror("ERROR reading to socket aca"); int x; /* Send received string and receive again until end of transmission */ while (recvMsgSize > 0) /* zero indicates end of transmission */ { /* Echo message back to client */ if (send(sock, buffer, recvMsgSize, 0) != recvMsgSize) perror("ERROR writing to socket alla"); for (x=0; x<recvMsgSize; x++) { printf("The count in %d %c\n",x, buffer[x]); } s1[] = buffer.Substring(2, 5); printf("String %s",s1[]); findRFC(buffer); /* See if there is more data to receive */ if ((recvMsgSize = recv(sock, buffer, 256, 0)) < 0) perror("ERROR reading to socket acuya"); } closesocket(sock); /* Close client socket */ }