#include <mono/io-layer/socket-private.h>
#include <mono/io-layer/handles-private.h>
#include <mono/io-layer/socket-wrappers.h>
#include <mono/io-layer/socket-private.h>
#include <mono/io-layer/handles-private.h>
#include <mono/io-layer/socket-wrappers.h>
static guint32 in_cleanup = 0;
static void socket_close (gpointer handle, gpointer data);
static guint32 in_cleanup = 0;
static void socket_close (gpointer handle, gpointer data);
- DEBUG ("%s: closing socket handle %p", __func__, handle);
+ MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: closing socket handle %p", __func__, handle);
/* Shutdown the socket for reading, to interrupt any potential
* receives that may be blocking for data. See bug 75705.
/* Shutdown the socket for reading, to interrupt any potential
* receives that may be blocking for data. See bug 75705.
- DEBUG ("%s: close error: %s", __func__, strerror (errno));
+ MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: close error: %s", __func__, strerror (errno));
errnum = errno_to_WSA (errnum, __func__);
if (!in_cleanup)
WSASetLastError (errnum);
errnum = errno_to_WSA (errnum, __func__);
if (!in_cleanup)
WSASetLastError (errnum);
- DEBUG ("%s: accept error: %s", __func__, strerror(errno));
+ MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: accept error: %s", __func__, strerror(errno));
errnum = errno_to_WSA (errnum, __func__);
WSASetLastError (errnum);
errnum = errno_to_WSA (errnum, __func__);
WSASetLastError (errnum);
- DEBUG ("%s: bind error: %s", __func__, strerror(errno));
+ MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: bind error: %s", __func__, strerror(errno));
errnum = errno_to_WSA (errnum, __func__);
WSASetLastError (errnum);
errnum = errno_to_WSA (errnum, __func__);
WSASetLastError (errnum);
- DEBUG ("%s: connect error: %s", __func__,
+ MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: connect error: %s", __func__,
__func__, strerror (errno));
WSASetLastError (errnum);
__func__, strerror (errno));
WSASetLastError (errnum);
__func__, strerror (errno));
WSASetLastError (errnum);
__func__, strerror (errno));
WSASetLastError (errnum);
__func__, strerror (so_error));
WSASetLastError (errnum);
__func__, strerror (so_error));
WSASetLastError (errnum);
- DEBUG ("%s: getpeername error: %s", __func__,
+ MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: getpeername error: %s", __func__,
- DEBUG ("%s: getsockname error: %s", __func__,
+ MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: getsockname error: %s", __func__,
ret = getsockopt (fd, level, optname, tmp_val, optlen);
if (ret == -1) {
gint errnum = errno;
ret = getsockopt (fd, level, optname, tmp_val, optlen);
if (ret == -1) {
gint errnum = errno;
- DEBUG ("%s: getsockopt error: %s", __func__,
+ MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: getsockopt error: %s", __func__,
- DEBUG ("%s: listen error: %s", __func__, strerror (errno));
+ MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: listen error: %s", __func__, strerror (errno));
errnum = errno_to_WSA (errnum, __func__);
WSASetLastError (errnum);
errnum = errno_to_WSA (errnum, __func__);
WSASetLastError (errnum);
- DEBUG ("%s: recv error: %s", __func__, strerror(errno));
+ MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: recv error: %s", __func__, strerror(errno));
errnum = errno_to_WSA (errnum, __func__);
WSASetLastError (errnum);
errnum = errno_to_WSA (errnum, __func__);
WSASetLastError (errnum);
- DEBUG ("%s: recvmsg error: %s", __func__, strerror(errno));
+ MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: recvmsg error: %s", __func__, strerror(errno));
errnum = errno_to_WSA (errnum, __func__);
WSASetLastError (errnum);
errnum = errno_to_WSA (errnum, __func__);
WSASetLastError (errnum);
- DEBUG ("%s: send error: %s", __func__, strerror (errno));
+ MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: send error: %s", __func__, strerror (errno));
- DEBUG ("%s: send error: %s", __func__, strerror (errno));
+ MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: send error: %s", __func__, strerror (errno));
errnum = errno_to_WSA (errnum, __func__);
WSASetLastError (errnum);
errnum = errno_to_WSA (errnum, __func__);
WSASetLastError (errnum);
- DEBUG ("%s: sendmsg error: %s", __func__, strerror (errno));
+ MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: sendmsg error: %s", __func__, strerror (errno));
errnum = errno_to_WSA (errnum, __func__);
WSASetLastError (errnum);
errnum = errno_to_WSA (errnum, __func__);
WSASetLastError (errnum);
(optname == SO_SNDBUF || optname == SO_RCVBUF)) {
/* According to socket(7) the Linux kernel doubles the
* buffer sizes "to allow space for bookkeeping
(optname == SO_SNDBUF || optname == SO_RCVBUF)) {
/* According to socket(7) the Linux kernel doubles the
* buffer sizes "to allow space for bookkeeping
ret = setsockopt (fd, level, optname, tmp_val, optlen);
if (ret == -1) {
gint errnum = errno;
ret = setsockopt (fd, level, optname, tmp_val, optlen);
if (ret == -1) {
gint errnum = errno;
- DEBUG ("%s: setsockopt error: %s", __func__,
+ MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: setsockopt error: %s", __func__,
socklen_t type_len = sizeof (type);
if (!getsockopt (fd, level, SO_TYPE, &type, &type_len)) {
socklen_t type_len = sizeof (type);
if (!getsockopt (fd, level, SO_TYPE, &type, &type_len)) {
setsockopt (fd, level, SO_REUSEPORT, tmp_val, optlen);
}
}
setsockopt (fd, level, SO_REUSEPORT, tmp_val, optlen);
}
}
- DEBUG ("%s: shutdown error: %s", __func__,
+ MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: shutdown error: %s", __func__,
- DEBUG ("%s: socket error: %s", __func__, strerror (errno));
+ MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: socket error: %s", __func__, strerror (errno));
errnum = errno_to_WSA (errnum, __func__);
WSASetLastError (errnum);
errnum = errno_to_WSA (errnum, __func__);
WSASetLastError (errnum);
__func__, fd, _wapi_fd_reserve);
WSASetLastError (WSASYSCALLFAILURE);
__func__, fd, _wapi_fd_reserve);
WSASetLastError (WSASYSCALLFAILURE);
- ret = setsockopt (fd, SOL_SOCKET, SO_REUSEADDR, &true,
- sizeof (true));
+ ret = setsockopt (fd, SOL_SOCKET, SO_REUSEADDR, &true_,
+ sizeof (true_));
errnum = errno_to_WSA (errnum, __func__);
WSASetLastError (errnum);
errnum = errno_to_WSA (errnum, __func__);
WSASetLastError (errnum);
- DEBUG ("%s: returning socket handle %p", __func__, handle);
+ MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: returning socket handle %p", __func__, handle);
- DEBUG ("%s: socket error: %s", __func__, strerror (errno));
+ MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: socket error: %s", __func__, strerror (errno));
errnum = errno_to_WSA (errnum, __func__);
WSASetLastError (errnum);
errnum = errno_to_WSA (errnum, __func__);
WSASetLastError (errnum);
- DEBUG ("%s: dup2 error: %s", __func__, strerror (errno));
+ MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: dup2 error: %s", __func__, strerror (errno));
errnum = errno_to_WSA (errnum, __func__);
WSASetLastError (errnum);
errnum = errno_to_WSA (errnum, __func__);
WSASetLastError (errnum);
static gboolean wapi_disconnectex (guint32 fd, WapiOverlapped *overlapped,
guint32 flags, guint32 reserved)
{
static gboolean wapi_disconnectex (guint32 fd, WapiOverlapped *overlapped,
guint32 flags, guint32 reserved)
{
- DEBUG ("%s: called on socket %d!", __func__, fd);
+ MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: called on socket %d!", __func__, fd);
- DEBUG("%s: WSAIoctl error: %s", __func__,
+ MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: WSAIoctl error: %s", __func__,
- DEBUG ("%s: ioctl error: %s", __func__, strerror (errno));
+ MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: ioctl error: %s", __func__, strerror (errno));
errnum = errno_to_WSA (errnum, __func__);
WSASetLastError (errnum);
errnum = errno_to_WSA (errnum, __func__);
WSASetLastError (errnum);
- DEBUG ("%s: select error: %s", __func__, strerror (errno));
+ MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: select error: %s", __func__, strerror (errno));
errnum = errno_to_WSA (errnum, __func__);
WSASetLastError (errnum);
errnum = errno_to_WSA (errnum, __func__);
WSASetLastError (errnum);