+// --------------------------------------------------------------------------
+// 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);
+ 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_notify_state = m_notify_state;
+ state->m_neededreq = m_neededreq;
+ state->m_flags = m_flags;
+ state->m_cbk = m_cbk;
+ state->m_cdata = m_cdata;
+
+ m_states.Append(state);
+}
+
+void wxSocketBase::RestoreState()
+{
+ wxNode *node;
+ wxSocketState *state;
+
+ node = m_states.Last();
+ if (!node)
+ return;
+
+ state = (wxSocketState *)node->Data();
+
+ SetFlags(state->m_flags);
+ m_cbk = state->m_cbk;
+ m_cdata = state->m_cdata;
+ m_neededreq = state->m_neededreq;
+ Notify(state->m_notify_state);
+
+ delete node;
+ delete state;
+}
+
+//
+// Timeout and flags
+//
+