#define SOCK_TEST_CFG_BUF_SIZE_MIN 128
#define SOCK_TEST_CFG_MAX_TEST_SCKTS 5
+#define SOCK_TEST_AF_UNIX_FILENAME "/tmp/ldp_server_af_unix_socket"
+#define SOCK_TEST_MIXED_EPOLL_DATA "Hello, world! (over an AF_UNIX socket)"
+#define SOCK_TEST_AF_UNIX_ACCEPT_DATA 0xaf0000af
+#define SOCK_TEST_AF_UNIX_FD_MASK 0x00af0000
+
typedef enum
{
SOCK_TEST_TYPE_NONE,
{
int errno_val = errno;
perror ("ERROR in sock_test_buf_alloc()");
- fprintf (stderr, "ERROR: Buffer allocation failed (errno = %d)!\n"
+ fprintf (stderr, "SOCK_TEST: ERROR: Buffer allocation "
+ "failed (errno = %d)!\n"
" Using buffer size %d instead of desired"
" size (%d)\n", errno_val, *bufsize, alloc_size);
}
stats->stop.tv_sec, stats->stop.tv_nsec);
printf (SOCK_TEST_SEPARATOR_STRING);
+
+#if SOCK_SERVER_USE_EPOLL && !defined (VCL_TEST)
+ printf (" af_unix xacts: %lu (0x%08lx)\n",
+ sock_server_main.af_unix_xacts);
+
+ printf (SOCK_TEST_SEPARATOR_STRING);
+#endif
}
static inline int
{
errno_val = errno;
perror ("ERROR in sock_test_read()");
- fprintf (stderr, "ERROR: socket read failed (errno = %d)!\n",
- errno_val);
+ fprintf (stderr, "SOCK_TEST: ERROR: socket read "
+ "failed (errno = %d)!\n", errno_val);
errno = errno_val;
}
else if (stats)
stats->tx_incomp++;
if (verbose)
{
- printf ("WARNING: bytes written (%d) != bytes to write (%d)!\n",
- tx_bytes, nbytes);
+ printf ("SOCK_TEST: WARNING: bytes written (%d) "
+ "!= bytes to write (%d)!\n", tx_bytes, nbytes);
}
}
{
errno_val = errno;
perror ("ERROR in sock_test_write()");
- fprintf (stderr, "ERROR: socket write failed (errno = %d)!\n",
- errno_val);
+ fprintf (stderr, "SOCK_TEST: ERROR: socket write failed "
+ "(errno = %d)!\n", errno_val);
}
else if (stats)
stats->tx_bytes += tx_bytes;