-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;
-}
-
-// --------------------------------------------------------------
-// wxSocketBase save and restore socket state
-// --------------------------------------------------------------
-
-void wxSocketBase::SaveState()
-{
- wxSocketState *state;
-
- state = new wxSocketState();
-
- state->notify_state = m_notify_state;
- state->evt_notify_state = m_neededreq;
- state->socket_flags = m_flags;
- state->c_callback = m_cbk;
- state->c_callback_data = 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->socket_flags);
- m_neededreq = state->evt_notify_state;
- m_cbk = state->c_callback;
- m_cdata = state->c_callback_data;
- Notify(state->notify_state);
-
- delete node;
- delete state;