+// ============================================================================
+// wxSocketImpl implementation
+// ============================================================================
+
+/* static */
+wxSocketImpl *wxSocketImpl::Create(wxSocketBase& wxsocket)
+{
+ return new wxSocketImplMSW(wxsocket);
+}
+
+void wxSocketImplMSW::DoClose()
+{
+ wxSocketManager::Get()->Uninstall_Callback(this);
+
+ closesocket(m_fd);
+}
+
+wxSocketError wxSocketImplMSW::GetLastError() const
+{
+ switch ( WSAGetLastError() )
+ {
+ case 0:
+ return wxSOCKET_NOERROR;
+
+ case WSAENOTSOCK:
+ return wxSOCKET_INVSOCK;
+
+ case WSAEWOULDBLOCK:
+ return wxSOCKET_WOULDBLOCK;
+
+ default:
+ return wxSOCKET_IOERR;
+ }
+}
+