[Issue 597] New: std.socket TcpSocket and UdpSocket are missing.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Nov 25 10:05:15 PST 2006


http://d.puremagic.com/issues/show_bug.cgi?id=597

           Summary: std.socket TcpSocket and UdpSocket are missing.
           Product: D
           Version: 0.175
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: godaves at yahoo.com


Somehow this code disappeared from the end of std/socket.d between 0.174 and
0.175:

/// TcpSocket is a shortcut class for a TCP Socket.
class TcpSocket: Socket
{
      /// Constructs a blocking TCP Socket.
      this(AddressFamily family)
      {
              super(family, SocketType.STREAM, ProtocolType.TCP);
      }

      /// Constructs a blocking TCP Socket.
      this()
      {
              this(cast(AddressFamily)AddressFamily.INET);
      }


      //shortcut
      /// Constructs a blocking TCP Socket and connects to an InternetAddress.
      this(Address connectTo)
      {
              this(connectTo.addressFamily());
              connect(connectTo);
      }
}

/// UdpSocket is a shortcut class for a UDP Socket.
class UdpSocket: Socket
{
      /// Constructs a blocking UDP Socket.
      this(AddressFamily family)
      {
              super(family, SocketType.DGRAM, ProtocolType.UDP);
      }


      /// Constructs a blocking UDP Socket.
      this()
      {
              this(cast(AddressFamily)AddressFamily.INET);
      }
}


-- 




More information about the Digitalmars-d-bugs mailing list