Thread overview
Socket
Feb 13, 2004
Phill
Feb 13, 2004
Vathix
Feb 13, 2004
Sean Kelly
Feb 13, 2004
Phill
February 13, 2004
Can anyone tell me how I can create a Socket
in D?
I have tried the following:
---------------------------
extern(Windows)
{
 SOCKET socket (int af, int type,  int protocol );
 }
-----------------------
From that
I get the following error:
 identifier 'SOCKET' is not defined

then later on I planned to do this:
----------------------------
Socket sock;
 if(sock.Create(port,SOCK_STREAM,NULL)){
  printf( "csock is created!" );
  }
------------------------

Are there ways to create a Socket in D yet?

Please dont say "use COM". Im on a big enough learning curve as it is.

Phill




February 13, 2004
Phill wrote:

> Can anyone tell me how I can create a Socket
> in D?
> I have tried the following:
> ---------------------------
> extern(Windows)
> {
>  SOCKET socket (int af, int type,  int protocol );
>  }

You would need to alias int SOCKET; as well. There are already some winsock.d files floating around with all this done, including my site.

-- 
Christopher E. Miller
www.dprogramming.com
irc.dprogramming.com #D
February 13, 2004
Vathix wrote:
>
> You would need to alias int SOCKET; as well. There are already some winsock.d files floating around with all this done, including my site.

One of these days I want to sit down and work out a multiplexed io spec for D but the language needs things like standard containers first.


Sean

February 13, 2004
Ok, thanks I will take a look!

Phill.


"Vathix" <vathix@dprogramming.com> wrote in message news:c0idae$1iub$1@digitaldaemon.com...
> Phill wrote:
>
> > Can anyone tell me how I can create a Socket
> > in D?
> > I have tried the following:
> > ---------------------------
> > extern(Windows)
> > {
> >  SOCKET socket (int af, int type,  int protocol );
> >  }
>
> You would need to alias int SOCKET; as well. There are already some winsock.d files floating around with all this done, including my site.
>
> --
> Christopher E. Miller
> www.dprogramming.com
> irc.dprogramming.com #D