Added debuf printf()s to GSocket,

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6640 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling 2000-03-12 21:26:48 +00:00
parent 6e7b6cc6f7
commit 856bc99a57
5 changed files with 15 additions and 3 deletions

View File

@ -17,7 +17,7 @@ PROGRAM=help
OBJECTS=demo.o
DATAFILES=doc
DATAFILES=doc.cnt doc.hlp doc.hpj doc.tex doc.zip back.gif forward.gif books.gif contents.gif
include ../../src/makeprog.env

View File

@ -486,7 +486,8 @@ void MyFrame::OnTest3(wxCommandEvent& WXUNUSED(event))
m_sock->SetFlags(wxSOCKET_WAITALL);
// Note that len is in kbytes here!
len = 32;
// Also note that Linux kernel 2.0.36 gives up at len > 27.
len = 28;
buf1 = new char[len * 1024];
buf2 = new char[len * 1024];

View File

@ -287,6 +287,7 @@ void MyFrame::Test3(wxSocketBase *sock)
sock->SetFlags(wxSOCKET_WAITALL);
sock->Read(&len, 1);
buf = new char[len * 1024];
sock->Read(buf, len * 1024);
sock->Write(buf, len * 1024);

View File

@ -466,7 +466,7 @@ wxUint32 wxSocketBase::_Write(const void *buffer, wxUint32 nbytes)
break;
ret = GSocket_Write(m_socket, (const char *)buffer, nbytes);
if (ret > 0)
{
total += ret;

View File

@ -714,6 +714,8 @@ int GSocket_Write(GSocket *socket, const char *buffer, int size)
int ret;
assert(socket != NULL);
printf( "GSocket_Write #1, size %d\n", size );
if (socket->m_fd == -1 || socket->m_server)
{
@ -721,16 +723,22 @@ int GSocket_Write(GSocket *socket, const char *buffer, int size)
return -1;
}
printf( "GSocket_Write #2, size %d\n", size );
/* If the socket is blocking, wait for writability (with a timeout) */
if (_GSocket_Output_Timeout(socket) == GSOCK_TIMEDOUT)
return -1;
printf( "GSocket_Write #3, size %d\n", size );
/* Write the data */
if (socket->m_stream)
ret = _GSocket_Send_Stream(socket, buffer, size);
else
ret = _GSocket_Send_Dgram(socket, buffer, size);
printf( "GSocket_Write #4, size %d\n", size );
if (ret == -1)
{
if (errno == EWOULDBLOCK)
@ -747,6 +755,8 @@ int GSocket_Write(GSocket *socket, const char *buffer, int size)
return -1;
}
printf( "GSocket_Write #5, size %d ret %d\n", size, ret );
return ret;
}