[netperf-dev] netperf2 commit notice r62 - trunk/src
raj at netperf.org
raj at netperf.org
Thu Mar 23 10:54:32 PST 2006
Author: raj
Date: 2006-03-23 10:54:30 -0800 (Thu, 23 Mar 2006)
New Revision: 62
Modified:
trunk/src/netlib.c
trunk/src/netlib.h
trunk/src/nettest_bsd.c
Log:
Patches for Windows and the TCP_CRR and TCP_CC tests, courtesy of Dickon
Reed
Modified: trunk/src/netlib.c
===================================================================
--- trunk/src/netlib.c 2006-03-21 23:25:32 UTC (rev 61)
+++ trunk/src/netlib.c 2006-03-23 18:54:30 UTC (rev 62)
@@ -173,6 +173,7 @@
} ;
#ifndef __VMS
SOCKET win_kludge_socket = INVALID_SOCKET;
+SOCKET win_kludge_socket2 = INVALID_SOCKET;
#endif /* __VMS */
#endif /* WIN32 || __VMS */
@@ -875,6 +876,9 @@
if (win_kludge_socket != INVALID_SOCKET) {
closesocket(win_kludge_socket);
}
+ if (win_kludge_socket2 != INVALID_SOCKET) {
+ closesocket(win_kludge_socket2);
+ }
}
}
Modified: trunk/src/netlib.h
===================================================================
--- trunk/src/netlib.h 2006-03-21 23:25:32 UTC (rev 61)
+++ trunk/src/netlib.h 2006-03-23 18:54:30 UTC (rev 62)
@@ -391,7 +391,7 @@
#endif /* _GETOPT_ */
-extern SOCKET win_kludge_socket;
+extern SOCKET win_kludge_socket, win_kludge_socket2;
#endif /* WIN32 */
extern int local_proc_affinity, remote_proc_affinity;
Modified: trunk/src/nettest_bsd.c
===================================================================
--- trunk/src/nettest_bsd.c 2006-03-21 23:25:32 UTC (rev 61)
+++ trunk/src/nettest_bsd.c 2006-03-23 18:54:30 UTC (rev 62)
@@ -4228,6 +4228,13 @@
exit(1);
}
+#ifdef WIN32
+ /* The test timer can fire during operations on the listening socket,
+ so to make the start_timer below work we have to move
+ it to close s_listen while we are blocked on accept. */
+ win_kludge_socket2 = s_listen;
+#endif
+
/* what sort of sizes did we end-up with? */
if (tcp_stream_request->receive_size == 0) {
if (lsr_size > 0) {
@@ -4576,6 +4583,14 @@
exit(1);
}
+#ifdef WIN32
+ /* The test timer can fire during operations on the listening socket,
+ so to make the start_timer below work we have to move
+ it to close s_listen while we are blocked on accept. */
+ win_kludge_socket2 = s_listen;
+#endif
+
+
/* what sort of sizes did we end-up with? */
if (tcp_maerts_request->send_size == 0) {
if (lss_size > 0) {
@@ -7426,6 +7441,15 @@
exit(1);
}
+
+#ifdef WIN32
+ /* The test timer can fire during operations on the listening socket,
+ so to make the start_timer below work we have to move
+ it to close s_listen while we are blocked on accept. */
+ win_kludge_socket2 = s_listen;
+#endif
+
+
/* Now, let's set-up the socket to listen for connections */
if (listen(s_listen, 5) == SOCKET_ERROR) {
netperf_response.content.serv_errno = errno;
@@ -8463,6 +8487,14 @@
exit(1);
}
+#ifdef WIN32
+ /* The test timer can fire during operations on the listening socket,
+ so to make the start_timer below work we have to move
+ it to close s_listen while we are blocked on accept. */
+ win_kludge_socket2 = s_listen;
+#endif
+
+
/* Now, let's set-up the socket to listen for connections */
if (listen(s_listen, 5) == SOCKET_ERROR) {
netperf_response.content.serv_errno = errno;
@@ -8552,6 +8584,12 @@
while ((!times_up) || (trans_remaining > 0)) {
/* accept a connection from the remote */
+#ifdef WIN32
+ /* The test timer will probably fire during this accept,
+ so to make the start_timer above work we have to move
+ it to close s_listen while we are blocked on accept. */
+ win_kludge_socket = s_listen;
+#endif
if ((s_data=accept(s_listen,
(struct sockaddr *)&peeraddr_in,
&addrlen)) == INVALID_SOCKET) {
@@ -9493,6 +9531,14 @@
exit(1);
}
+#ifdef WIN32
+ /* The test timer can fire during operations on the listening socket,
+ so to make the start_timer below work we have to move
+ it to close s_listen while we are blocked on accept. */
+ win_kludge_socket2 = s_listen;
+#endif
+
+
/* Let's get an address assigned to this socket so we can tell the */
/* initiator how to reach the data socket. There may be a desire to */
/* nail this socket to a specific IP address in a multi-homed, */
@@ -11501,6 +11547,14 @@
exit(1);
}
+#ifdef WIN32
+ /* The test timer can fire during operations on the listening socket,
+ so to make the start_timer below work we have to move
+ it to close s_listen while we are blocked on accept. */
+ win_kludge_socket2 = s_listen;
+#endif
+
+
/* Now, let's set-up the socket to listen for connections */
if (listen(s_listen, 5) == SOCKET_ERROR) {
netperf_response.content.serv_errno = errno;
@@ -11588,7 +11642,12 @@
trans_received = 0;
while ((!times_up) || (trans_remaining > 0)) {
-
+#ifdef WIN32
+ /* The test timer will probably fire during this accept,
+ so to make the start_timer above work we have to move
+ it to close s_listen while we are blocked on accept. */
+ win_kludge_socket = s_listen;
+#endif
/* accept a connection from the remote */
if ((s_data=accept(s_listen,
(struct sockaddr *)&peeraddr_in,
More information about the netperf-dev
mailing list