/*
* Copyright 2000, International Business Machines Corporation and others.
* All Rights Reserved.
- *
+ *
* This software has been released under the terms of the IBM Public
* License. For details, see the LICENSE file in the top-level source
* directory or online at http://www.openafs.org/dl/license10.html
# include <sys/ioctl.h>
# include <sys/time.h>
#endif
+# include <assert.h>
# include "rx.h"
+# include "rx_atomic.h"
# include "rx_globals.h"
+# include "rx_stats.h"
# include <lwp.h>
#define MAXTHREADNAMELENGTH 64
code = LWP_CurrentProcess(&pid);
if (code) {
fprintf(stderr, "rxi_Listener: Can't get my pid.\n");
- exit(1);
+ assert(0);
}
rx_listenerPid = pid;
if (swapNameProgram)
(*swapNameProgram) (pid, "listener", &name[0]);
for (;;) {
+ /* See if a check for additional packets was issued */
+ rx_CheckPackets();
+
/* Grab a new packet only if necessary (otherwise re-use the old one) */
if (p) {
rxi_RestoreDataBufs(p);
tv.tv_usec = cv.usec;
tvp = &tv;
}
- rx_stats.selects++;
+ if (rx_stats_active)
+ rx_atomic_inc(&rx_stats.selects);
*rfds = rx_selectMask;
fd_set *sfds = (fd_set *) 0;
while (sendmsg(socket, msg_p, flags) == -1) {
int err;
- rx_stats.sendSelects++;
+ if (rx_stats_active)
+ rx_atomic_inc(&rx_stats.sendSelects);
if (!sfds) {
if (!(sfds = IOMGR_AllocFDSet())) {
{
(osi_Msg "rx failed to send packet: ");
perror("rx_sendmsg");
+#ifndef AFS_NT40_ENV
+ if (errno > 0)
+ return -errno;
+#else
+ if (WSAGetLastError() > 0)
+ return -WSAGetLastError();
+#endif
return -1;
}
while ((err = select(socket + 1, 0, sfds, 0, 0)) != 1) {