This commit is contained in:
Steve Checkoway
2004-03-17 13:31:42 +00:00
parent 36b557bac2
commit 45c4577df2
4 changed files with 21 additions and 32 deletions
+4 -8
View File
@@ -161,7 +161,7 @@ bool EzSockets::receive(std::vector<char> &data) {
return true;
}
bool EzSockets::send(std::string data) {
bool EzSockets::send(const std::string& data) {
/* First send send the length of the data to the
server. Then if the length is less than or equal
to the 1024 then send data in one sendData()
@@ -257,10 +257,9 @@ bool EzSockets::sendData(char data[1024], int size) {
return true;
}
bool EzSockets::connect(std::string host, unsigned short port) {
if (!check()) {
bool EzSockets::connect(const std::string& host, unsigned short port) {
if (!check())
return false;
}
#if defined(WIN32)
struct hostent* phe;
@@ -278,10 +277,7 @@ bool EzSockets::connect(std::string host, unsigned short port) {
int desc = ::connect(sock,(struct sockaddr *)&addr,sizeof(addr));
#endif
if (desc < 0) {
return false;
}
return true;
return desc >= 0;
}
long EzSockets::uAddr() {