Added GSocket for Unix (only GTK for the moment)
Updated wxSocket to use GSocket API Added a progress bar to client.cpp Added CopyTo to wxMemoryOutputStream to copy the internal buffer to a specified buffer. Various changes/fixes to the high-level protocols FTP/HTTP Various Unicode fixes Removed sckint.* git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3085 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -42,15 +42,21 @@ wxSocketOutputStream::~wxSocketOutputStream()
|
||||
{
|
||||
}
|
||||
|
||||
wxOutputStream& wxSocketOutputStream::Write(const void *buffer, size_t size)
|
||||
{
|
||||
m_lastcount = m_o_socket->Write((const char *)buffer, size).LastCount();
|
||||
return *this;
|
||||
}
|
||||
|
||||
size_t wxSocketOutputStream::OnSysWrite(const void *buffer, size_t size)
|
||||
{
|
||||
return m_o_socket->Write((const char *)buffer, size).LastCount();
|
||||
size_t ret;
|
||||
|
||||
ret = m_o_socket->Write((const char *)buffer, size).LastCount();
|
||||
switch (m_o_socket->LastError()) {
|
||||
case GSOCK_NOERROR:
|
||||
m_lasterror = wxStream_NOERROR;
|
||||
break;
|
||||
default:
|
||||
m_lasterror = wxStream_READ_ERR;
|
||||
break;
|
||||
}
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -66,15 +72,20 @@ wxSocketInputStream::~wxSocketInputStream()
|
||||
{
|
||||
}
|
||||
|
||||
wxInputStream& wxSocketInputStream::Read(void *buffer, size_t size)
|
||||
{
|
||||
m_lastcount = m_i_socket->Read((char *)buffer, size).LastCount();
|
||||
return *this;
|
||||
}
|
||||
|
||||
size_t wxSocketInputStream::OnSysRead(void *buffer, size_t size)
|
||||
{
|
||||
return m_i_socket->Read((char *)buffer, size).LastCount();
|
||||
size_t ret;
|
||||
|
||||
ret = m_i_socket->Read((char *)buffer, size).LastCount();
|
||||
switch (m_i_socket->LastError()) {
|
||||
case GSOCK_NOERROR:
|
||||
m_lasterror = wxStream_NOERROR;
|
||||
break;
|
||||
default:
|
||||
m_lasterror = wxStream_WRITE_ERR;
|
||||
break;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user