0
0
mirror of https://github.com/yse/easy_profiler.git synced 2024-12-28 01:04:41 +08:00

Warning fix

This commit is contained in:
Sergey Yagovtsev 2016-09-20 23:25:13 +03:00
parent d6269f17fe
commit 7804cf8b92
2 changed files with 5 additions and 11 deletions

View File

@ -1041,12 +1041,6 @@ void EasyMainWindow::readTcpData()
} }
if (m_receivedProfileData.str().size() > necessarySize)
{
qInfo() << "recieve more than necessary d=" << m_receivedProfileData.str().size() - necessarySize;
}
if (m_recFrames) if (m_recFrames)
{ {
m_receivedProfileData.write(data.data(), data.size()); m_receivedProfileData.write(data.data(), data.size());

View File

@ -165,7 +165,7 @@ int EasySocket::send(const void *buf, size_t nbyte)
if(!checkSocket(m_replySocket)) return -1; if(!checkSocket(m_replySocket)) return -1;
int res = 0; int res = 0;
#ifdef _WIN32 #ifdef _WIN32
res = ::send(m_replySocket, (const char*)buf, nbyte, 0); res = ::send(m_replySocket, (const char*)buf, (int)nbyte, 0);
#else #else
res = ::write(m_replySocket,buf,nbyte); res = ::write(m_replySocket,buf,nbyte);
#endif #endif
@ -178,7 +178,7 @@ int EasySocket::receive(void *buf, size_t nbyte)
if(!checkSocket(m_replySocket)) return -1; if(!checkSocket(m_replySocket)) return -1;
int res = 0; int res = 0;
#ifdef _WIN32 #ifdef _WIN32
res = ::recv(m_replySocket, (char*)buf, nbyte, 0); res = ::recv(m_replySocket, (char*)buf, (int)nbyte, 0);
#else #else
res = ::read(m_replySocket,buf,nbyte); res = ::read(m_replySocket,buf,nbyte);
#endif #endif
@ -203,19 +203,19 @@ int EasySocket::accept()
if(!checkSocket(m_socket)) return -1; if(!checkSocket(m_socket)) return -1;
m_replySocket = ::accept(m_socket,nullptr,nullptr); m_replySocket = ::accept(m_socket,nullptr,nullptr);
checkResult(m_replySocket); checkResult((int)m_replySocket);
if(checkSocket(m_replySocket)) if(checkSocket(m_replySocket))
{ {
int send_buffer = 64*1024*1024; int send_buffer = 64*1024*1024;
int send_buffer_sizeof = sizeof(int); int send_buffer_sizeof = sizeof(int);
setsockopt(m_replySocket, SOL_SOCKET, SO_SNDBUF, (char*)&send_buffer, send_buffer_sizeof); setsockopt(m_replySocket, SOL_SOCKET, SO_SNDBUF, (char*)&send_buffer, send_buffer_sizeof);
//int flag = 1; //int flag = 1;
//int result = setsockopt(m_replySocket,IPPROTO_TCP,TCP_NODELAY,(char *)&flag,sizeof(int)); //int result = setsockopt(m_replySocket,IPPROTO_TCP,TCP_NODELAY,(char *)&flag,sizeof(int));
//setBlocking(m_replySocket,true); //setBlocking(m_replySocket,true);
} }
return m_replySocket; return (int)m_replySocket;
} }
bool EasySocket::setAddress(const char *serv, uint16_t portno) bool EasySocket::setAddress(const char *serv, uint16_t portno)