fixed a minor but annoying bug in ClientSocket/ServerSocket.recv()
parent
d19e5671d2
commit
94df6b68ca
|
@ -36,6 +36,7 @@ int ClientSocket::send(std::string msg, int flags=0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int ClientSocket::recv(int flags) {
|
int ClientSocket::recv(int flags) {
|
||||||
|
memset(&_buf[0], 0, sizeof(_buf));
|
||||||
if(_protocol == "TCP") {
|
if(_protocol == "TCP") {
|
||||||
int rr = ::recv(_descriptor, buf, 99999, flags);
|
int rr = ::recv(_descriptor, buf, 99999, flags);
|
||||||
if(rr == -1) {
|
if(rr == -1) {
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -121,6 +121,7 @@ int ServerSocket::send(std::string msg, int flags) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int ServerSocket::recv(int flags) {
|
int ServerSocket::recv(int flags) {
|
||||||
|
memset(&_buf[0], 0, sizeof(_buf));
|
||||||
if(_protocol == "TCP") {
|
if(_protocol == "TCP") {
|
||||||
int rr = ::recv(_newDescriptor, _buf, 99999, flags);
|
int rr = ::recv(_newDescriptor, _buf, 99999, flags);
|
||||||
if(rr == -1) {
|
if(rr == -1) {
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue