fixed a minor but annoying bug in ClientSocket/ServerSocket.recv()
This commit is contained in:
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) {
|
||||||
|
BIN
ClientSocket.o
Normal file
BIN
ClientSocket.o
Normal file
Binary file not shown.
BIN
HTTPClientSocket.o
Normal file
BIN
HTTPClientSocket.o
Normal file
Binary file not shown.
BIN
NetSocket.o
Normal file
BIN
NetSocket.o
Normal file
Binary file not shown.
BIN
NetworkException.o
Normal file
BIN
NetworkException.o
Normal file
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) {
|
||||||
|
BIN
ServerSocket.o
Normal file
BIN
ServerSocket.o
Normal file
Binary file not shown.
BIN
SocketException.o
Normal file
BIN
SocketException.o
Normal file
Binary file not shown.
BIN
libnetsocketpp.so.0.1
Executable file
BIN
libnetsocketpp.so.0.1
Executable file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user