Hello!
I'm creating a simple pop3 client, but the problem is that my code doesn't recognize the '+' character! I don't get it! It should work!!!
It doesn't print out '+'! Thank you!Code:#include <sys/socket.h> #include <sys/types.h> #include <netinet/in.h> #include <arpa/inet.h> #include <iostream> #include <sys/io.h> using namespace std; int main(){ int sock_fd, recv_data_size; char buffer[100]; struct sockaddr_in server; if((sock_fd = socket(AF_INET, SOCK_STREAM, 0)) == -1){ perror("socket();"); } server.sin_family = AF_INET; server.sin_port = htons(324); server.sin_addr.s_addr = inet_addr("127.0.0.1"); if(connect(sock_fd, (struct sockaddr *)&server, sizeof(struct sockaddr)) == -1){ perror("connect();"); } recv_data_size = recv(sock_fd, buffer, sizeof(buffer), 0); for(int i=0; i<recv_data_size; i++){ if(strcmp(buffer, "+") == 0){ cout << "+\n"; } } return 0; }



LinkBack URL
About LinkBacks


