Chinaunix首页 | 论坛 | 博客
  • 博客访问: 907291
  • 博文数量: 201
  • 博客积分: 8078
  • 博客等级: 中将
  • 技术积分: 2162
  • 用 户 组: 普通用户
  • 注册时间: 2008-05-20 17:22
文章分类

全部博文(201)

文章存档

2013年(3)

2012年(11)

2011年(34)

2010年(25)

2009年(51)

2008年(77)

分类: 系统运维

2008-07-11 13:18:06

目前仅供测试, 不能用来下载的:

另外这个补丁只能用来让btload在windows下编译通过运行. 但是不会解决以下问题:
windows 下的select的最多64个socket的问题. 连接失败时反映在exceptfds中, 而不是readfds中.(所以最好不要关掉超时控制的代码). 要打开 DISABLE_PROXY.
估计到时候需要重新实现 windows 的select, 以方便绕过去, 否则只能使用完成端口了.

diff -uN d:\nfast\btload\nfast\bsocket.cc btload\bsocket.cc
--- d:\nfast\btload\nfast\bsocket.cc    Fri Jul 11 11:04:36 2008
+++ btload\bsocket.cc    Fri Jul 11 12:22:33 2008
@@ -2,13 +2,8 @@
 #include <time.h>
 #include <assert.h>
 #include <stdio.h>
-#include <errno.h>
 #include <unistd.h>
-#include <fcntl.h>
-#include <netdb.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <sys/socket.h>
+#include <winsock.h>
 #include "bthread.h"
 #include "biothread.h"
 #include "bsocket.h"
@@ -17,6 +12,16 @@
 #define INADDR_NONE -1
 #endif
 
+typedef int socklen_t;
+
+#undef errno
+#undef EAGAIN
+#undef EINPROGRESS
+
+#define errno WSAGetLastError()
+#define EAGAIN WSAEWOULDBLOCK
+#define EINPROGRESS WSAEWOULDBLOCK
+
 

阅读(1872) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~