- 论坛徽章:
- 1
|
我使用ACE中的ACE_SOCK_Connector , 设置超时为3sec.
当连接数超过1155(概数)时, 就容易崩溃,
我用strace跟踪了一下,发现ACE中的select connect_fd这个句柄时, fd_set中多了好多, 按道理应该只有一个才对,
- 19934 10:48:29 <... socket resumed> ) = 1178
- 19934 10:48:29 fcntl64(1178, F_GETFL <unfinished ...>
- 19934 10:48:29 <... fcntl64 resumed> ) = 0x2 (flags O_RDWR)
- 19934 10:48:29 fcntl64(1178, F_SETFL, O_RDWR|O_NONBLOCK <unfinished ...>
- 19934 10:48:29 <... fcntl64 resumed> ) = 0
- 19934 10:48:29 connect(1178, {sa_family=AF_INET, sin_port=htons(8081), sin_addr=inet_addr("192.168.1.52")}, 16 <unfinished ...>
- 19934 10:48:29 <... connect resumed> ) = -1 EINPROGRESS (Operation now in progress)
- 19934 10:48:29 select(1179, [26 1025 1035 1058 1088 1090 1091 1092 1094 1095 1096 1098 1100 1103 1106 1108 1109 1124 1125 1126 1129 1131 1133 1136 1138 1140 1147 1155 1156 1158 1161 1162 1163 1164 1165 1166 1167 1172 1173 1174 1175 1176 1177 1178], [1024 1039 1040 1042 1043 1045 1047 1048 1049 1051 1052 1053 1054 1055 1056 1089 1091 1092 1095 1098 1130 1178], NULL, {3, 0} <unfinished ...>
- 19934 10:48:29 <... select resumed> ) = 61 (in [26 1088 1090 1091 1092 1094 1095 1096 1098 1100 1103 1106 1108 1109 1124 1125 1126 1129 1131 1133 1136 1138 1140 1147 1155 1156 1158 1161 1162 1163 1164 1165 1166 1167 1172 1173 1174 1175 1176 1177], out [1024 1039 1040 1042 1043 1045 1047 1048 1049 1051 1052 1053 1054 1055 1056 1089 1091 1092 1095 1098 1130 1178], left {3, 0})
复制代码 |
|