diff --git a/src/socket.cpp b/src/socket.cpp
index 9fafb91..955c1e2 100644
--- a/src/socket.cpp
+++ b/src/socket.cpp
@@ -2853,9 +2853,13 @@ size_t  DCCPSocket::available()
 		 error(errInput,(char *)"Error on retrieve the FIONREAD option.",socket_errno);
 	 }
 #else
-	if (ioctlsocket(so, FIOREAD, &readsize)){
+    u_long size = 0;
+
+	if (ioctlsocket(so, FIONREAD, &size)){
 		error(errInput,(char *)"Error on retrieve the FIONREAD option.",socket_errno);
 	}
+
+    readsize = size;
 #endif
 	return readsize;
 }
