www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - SocketOptionLevel on Linux

reply "shinichiro.h" <s31552 mail.ecc.u-tokyo.ac.jp> writes:
Hi,

I think SocketOptionLevel of std.socket is not correct on Linux.
The following patch seems to work good:

--- socket_orig.d	2004-11-04 04:44:23.477309760 +0900
+++ socket.d	2004-11-04 04:46:28.006378464 +0900
   -902,15 +902,6   
 }
 
 
-enum SocketOptionLevel: int
-{
-	SOCKET =  0xFFFF, //different source 1
-	IP =      0,
-	TCP =     6,
-	UDP =     17,
-}
-
-
 struct linger
 {
 	// D interface
   -943,6 +934,14   
 		// SocketOptionLevel.TCP:
 		TCP_NODELAY = 1,
 	}
+
+	enum SocketOptionLevel: int
+	{
+		SOCKET =  0xFFFF, //different source 1
+		IP =      0,
+		TCP =     6,
+		UDP =     17,
+	}
 }
 else version(linux)
 {
   -961,6 +960,14   
 		// SocketOptionLevel.TCP:
 		TCP_NODELAY = 1,
 	}
+
+	enum SocketOptionLevel: int
+	{
+		SOCKET =  1,
+		IP =      0,
+		TCP =     6,
+		UDP =     17,
+	}
 }
 else
 {

------------------
 shinichiro.h
Nov 03 2004
parent reply "Walter" <newshound digitalmars.com> writes:
This just changes SOCKET from 0xFFFF to 1?

"shinichiro.h" <s31552 mail.ecc.u-tokyo.ac.jp> wrote in message
news:20041104045006.5f453493.s31552 mail.ecc.u-tokyo.ac.jp...
 Hi,

 I think SocketOptionLevel of std.socket is not correct on Linux.
 The following patch seems to work good:

 --- socket_orig.d 2004-11-04 04:44:23.477309760 +0900
 +++ socket.d 2004-11-04 04:46:28.006378464 +0900
    -902,15 +902,6   
  }


 -enum SocketOptionLevel: int
 -{
 - SOCKET =  0xFFFF, //different source 1
 - IP =      0,
 - TCP =     6,
 - UDP =     17,
 -}
 -
 -
  struct linger
  {
   // D interface
    -943,6 +934,14   
   // SocketOptionLevel.TCP:
   TCP_NODELAY = 1,
   }
 +
 + enum SocketOptionLevel: int
 + {
 + SOCKET =  0xFFFF, //different source 1
 + IP =      0,
 + TCP =     6,
 + UDP =     17,
 + }
  }
  else version(linux)
  {
    -961,6 +960,14   
   // SocketOptionLevel.TCP:
   TCP_NODELAY = 1,
   }
 +
 + enum SocketOptionLevel: int
 + {
 + SOCKET =  1,
 + IP =      0,
 + TCP =     6,
 + UDP =     17,
 + }
  }
  else
  {

 ------------------
  shinichiro.h
Nov 08 2004
parent reply Vathix <vathix dprogramming.com> writes:
On Mon, 8 Nov 2004 00:36:32 -0800, Walter <newshound digitalmars.com>  
wrote:

 This just changes SOCKET from 0xFFFF to 1?
That's what I got from it; I couldn't get the patch to work. I've known about that and a couple other things for awhile, and I've been working on the next socket.d version, which should be ready soon. I've been trying to add IPv6 support.
Nov 08 2004
next sibling parent "Walter" <newshound digitalmars.com> writes:
"Vathix" <vathix dprogramming.com> wrote in message
news:opsg5ckojakcck4r tc3-ppp116.dialup.wzrd.com...
 On Mon, 8 Nov 2004 00:36:32 -0800, Walter <newshound digitalmars.com>
 wrote:

 This just changes SOCKET from 0xFFFF to 1?
That's what I got from it; I couldn't get the patch to work. I've known about that and a couple other things for awhile, and I've been working on the next socket.d version, which should be ready soon. I've been trying to add IPv6 support.
Ok, I'll defer to you on that, then! Thanks.
Nov 08 2004
prev sibling parent reply Regan Heath <regan netwin.co.nz> writes:
On Mon, 08 Nov 2004 07:49:26 -0500, Vathix <vathix dprogramming.com> wrote:
 On Mon, 8 Nov 2004 00:36:32 -0800, Walter <newshound digitalmars.com>  
 wrote:

 This just changes SOCKET from 0xFFFF to 1?
That's what I got from it; I couldn't get the patch to work. I've known about that and a couple other things for awhile, and I've been working on the next socket.d version, which should be ready soon. I've been trying to add IPv6 support.
Is it your intention to move the system socket information out of std.socket and into a std.c.<thing> or similar? Regan -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Nov 08 2004
parent reply Vathix <vathix dprogramming.com> writes:
On Tue, 09 Nov 2004 10:12:46 +1300, Regan Heath <regan netwin.co.nz> wrote:

 Is it your intention to move the system socket information out of  
 std.socket and into a std.c.<thing> or similar?

 Regan
Yes, I already did that :D std.c.linux.socket std.c.windows.winsock
Nov 08 2004
parent reply Regan Heath <regan netwin.co.nz> writes:
On Mon, 08 Nov 2004 16:37:40 -0500, Vathix <vathix dprogramming.com> wrote:
 On Tue, 09 Nov 2004 10:12:46 +1300, Regan Heath <regan netwin.co.nz> 
 wrote:

 Is it your intention to move the system socket information out of  
 std.socket and into a std.c.<thing> or similar?

 Regan
Yes, I already did that :D std.c.linux.socket std.c.windows.winsock
Oh, I cannot find either of those files and std.socket still has these things in it.. const int WSAEWOULDBLOCK = 10035; const int WSAEINTR = 10004; etc.. Regan -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Nov 08 2004
parent Vathix <vathix dprogramming.com> writes:
On Tue, 09 Nov 2004 12:21:06 +1300, Regan Heath <regan netwin.co.nz> wrote:

 On Mon, 08 Nov 2004 16:37:40 -0500, Vathix <vathix dprogramming.com>  
 wrote:
 On Tue, 09 Nov 2004 10:12:46 +1300, Regan Heath <regan netwin.co.nz>  
 wrote:

 Is it your intention to move the system socket information out of   
 std.socket and into a std.c.<thing> or similar?

 Regan
Yes, I already did that :D std.c.linux.socket std.c.windows.winsock
Oh, I cannot find either of those files and std.socket still has these things in it.. const int WSAEWOULDBLOCK = 10035; const int WSAEINTR = 10004; etc.. Regan
Well, I meant for the next version.
Nov 08 2004