From: Vadim Zeitlin Date: Tue, 30 Dec 2008 11:27:41 +0000 (+0000) Subject: added wxSocket::ShutdownOutput() (closes #9229) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/b67397a779eef3fb22ee143c8bd4e027c8c5dfc8 added wxSocket::ShutdownOutput() (closes #9229) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57656 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/docs/changes.txt b/docs/changes.txt index ee21e98b06..680a4bdbb8 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -323,9 +323,7 @@ All: - Added wxString::Capitalize() and MakeCapitalized(). - Added wxArray::swap(). - Added wxSHUTDOWN_LOGOFF and wxSHUTDOWN_FORCE wxShutdown() flags (troelsk). -- Added wxArtProvider::GetNativeSizeHint(); GetSizeHint() as well as - GetNativeSizeHint() now return more sensible values in wxMSW and wxMac and - no longer return bogus values. +- Added wxSocket::ShutdownOutput(). All (Unix): @@ -431,6 +429,9 @@ All (GUI): - Add wxEVT_GRID_CELL_CHANGING event matching wxEVT_GRID_CELL_CHANGED. - Get/HasModifiers() of wxKeyEvent are now also available in wxMouseEvent. - Provide new/old cell value in wxEVT_GRID_CELL_CHANGING/CHANGED events. +- Added wxArtProvider::GetNativeSizeHint(); GetSizeHint() as well as + GetNativeSizeHint() now return more sensible values in wxMSW and wxMac and + no longer return bogus values. wxGTK: diff --git a/include/wx/socket.h b/include/wx/socket.h index 88291e6ac2..2ce26e5345 100644 --- a/include/wx/socket.h +++ b/include/wx/socket.h @@ -132,6 +132,7 @@ public: // base IO virtual bool Close(); + void ShutdownOutput(); wxSocketBase& Discard(); wxSocketBase& Peek(void* buffer, wxUint32 nbytes); wxSocketBase& Read(void* buffer, wxUint32 nbytes); diff --git a/interface/wx/socket.h b/interface/wx/socket.h index 621df49adf..d6cd5ccce9 100644 --- a/interface/wx/socket.h +++ b/interface/wx/socket.h @@ -819,6 +819,15 @@ public: */ void Close(); + /** + Shuts down the writing end of the socket. + + This function simply calls the standard shutdown() function on the + underlying socket, indicating that nothing will be written to this + socket any more. + */ + void ShutdownOutput(); + /** This function simply deletes all bytes in the incoming queue. This function always returns immediately and its operation is not affected by IO flags. diff --git a/src/common/socket.cpp b/src/common/socket.cpp index ba15840b28..f03558c0b7 100644 --- a/src/common/socket.cpp +++ b/src/common/socket.cpp @@ -770,14 +770,19 @@ bool wxSocketBase::Close() // Interrupt pending waits InterruptWait(); - if (m_impl) - m_impl->Shutdown(); + ShutdownOutput(); m_connected = false; m_establishing = false; return true; } +void wxSocketBase::ShutdownOutput() +{ + if ( m_impl ) + m_impl->Shutdown(); +} + wxSocketBase& wxSocketBase::Read(void* buffer, wxUint32 nbytes) { // Mask read events