c++ - WinSock: server receives bytes from telnet, not from client -
i trying write client connects server written labmate. can make connection both telnet , own client program using winsock. telnet sends , receives commands fine, client can receive , not send any, despite not receiving error upon starting send()
.
a snippet of client code:
// after connection. // receive message first. recv_size = recv(socket_test, server_resp, strlen(server_resp), null); // check later. server_resp[recv_size] = '\0'; printf(server_resp); // prints initial send server fine. printf("\n"); int bytes; char testmess[100]; // contains test message send. cin >> testmess; bytes = send(socket_test, testmess, strlen(testmess), 0); printf("%d", bytes); // displays right number.
i'm wondering difference between send methods between telnet , winsock send()
be? have socket configured standard sock_stream
type.
Comments
Post a Comment