+// --------------------------------------------------------------------------
+// Miscellaneous
+// --------------------------------------------------------------------------
+
+//
+// Get local or peer address
+//
+
+bool wxSocketBase::GetPeer(wxSockAddress& addr_man) const
+{
+ GAddress *peer;
+
+ if (!m_socket)
+ return FALSE;
+
+ peer = GSocket_GetPeer(m_socket);
+
+ // copying a null address would just trigger an assert anyway
+
+ if (!peer)
+ return FALSE;
+
+ addr_man.SetAddress(peer);
+ GAddress_destroy(peer);
+
+ return TRUE;
+}
+
+bool wxSocketBase::GetLocal(wxSockAddress& addr_man) const
+{
+ GAddress *local;
+
+ if (!m_socket)
+ return FALSE;
+
+ local = GSocket_GetLocal(m_socket);
+ addr_man.SetAddress(local);
+ GAddress_destroy(local);
+
+ return TRUE;
+}
+
+//
+// Save and restore socket state
+//
+
+void wxSocketBase::SaveState()
+{
+ wxSocketState *state;
+
+ state = new wxSocketState();
+
+ state->m_flags = m_flags;
+ state->m_notify = m_notify;
+ state->m_eventmask = m_eventmask;
+ state->m_clientData = m_clientData;
+#if WXWIN_COMPATIBILITY
+ state->m_cbk = m_cbk;
+ state->m_cdata = m_cdata;
+#endif // WXWIN_COMPATIBILITY
+
+ m_states.Append(state);
+}
+
+void wxSocketBase::RestoreState()
+{
+ wxNode *node;
+ wxSocketState *state;
+
+ node = m_states.Last();
+ if (!node)
+ return;
+
+ state = (wxSocketState *)node->Data();
+
+ m_flags = state->m_flags;
+ m_notify = state->m_notify;
+ m_eventmask = state->m_eventmask;
+ m_clientData = state->m_clientData;
+#if WXWIN_COMPATIBILITY
+ m_cbk = state->m_cbk;
+ m_cdata = state->m_cdata;
+#endif // WXWIN_COMPATIBILITY
+
+ delete node;
+ delete state;
+}
+
+//
+// Timeout and flags
+//
+