This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
| Author | christian.heimes |
|---|---|
| Recipients | christian.heimes, gvanrossum, nnorwitz, roudkerk, theller |
| Date | 2007年11月14日.18:45:05 |
| SpamBayes Score | 0.052936815 |
| Marked as misclassified | No |
| Message-id | <1195065905.59.0.853545113036.issue1378@psf.upfronthosting.co.za> |
| In-reply-to |
| Content | |
|---|---|
Neal, Thomas, what do you think about the patch? Your knowledge of the
Windows API is greater than mine. Is the duplicate_socket() function ok?
I don't want to apply a patch I don't fully understand.
+#ifdef MS_WINDOWS
+/* On Windows a socket is really a handle not an fd */
+static SOCKET
+duplicate_socket(SOCKET handle)
+{
+ HANDLE newhandle;
+
+ if (!DuplicateHandle(GetCurrentProcess(), (HANDLE)handle,
+ GetCurrentProcess(), &newhandle,
+ 0, FALSE, DUPLICATE_SAME_ACCESS))
+ {
+ WSASetLastError(WSAEBADF);
+ return INVALID_SOCKET;
+ }
+ return (SOCKET)newhandle;
+}
+#define dup(fd) duplicate_socket(fd)
+#define SOCKETCLOSE closesocket
+#define NO_MAKEFILE /* socket handles can't be treated like file handles */
+#endif |
|
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2007年11月14日 18:45:05 | christian.heimes | set | spambayes_score: 0.0529368 -> 0.052936815 recipients: + christian.heimes, gvanrossum, nnorwitz, theller, roudkerk |
| 2007年11月14日 18:45:05 | christian.heimes | set | spambayes_score: 0.0529368 -> 0.0529368 messageid: <1195065905.59.0.853545113036.issue1378@psf.upfronthosting.co.za> |
| 2007年11月14日 18:45:05 | christian.heimes | link | issue1378 messages |
| 2007年11月14日 18:45:05 | christian.heimes | create | |