Thread overview |
---|
February 24, 2010 Simple Socket Server Code | ||||
---|---|---|---|---|
| ||||
All, Does anyone know where I can get a simple example of writing a server in D? Just a stupid little echo server would be fine. I'm trying to write one myself, but for some reason it doesn't seem to be accepting any connections. I figure it's something stupidly simple, but I'm just not seeing it. Perhaps a related question is: is there anything weird about creating a server on windows? I'm currently using D on a windows laptop, so perhaps this is a platform issue? I find it unlikely, but you never know. Thanks. Casey |
February 24, 2010 Re: Simple Socket Server Code | ||||
---|---|---|---|---|
| ||||
Posted in reply to sybrandy | sybrandy Wrote:
> All,
>
> Does anyone know where I can get a simple example of writing a server in D? Just a stupid little echo server would be fine. I'm trying to write one myself, but for some reason it doesn't seem to be accepting any connections. I figure it's something stupidly simple, but I'm just not seeing it.
>
> Perhaps a related question is: is there anything weird about creating a server on windows? I'm currently using D on a windows laptop, so perhaps this is a platform issue? I find it unlikely, but you never know.
>
> Thanks.
>
> Casey
Check the "samples" dir inside the dmd instalation folder.
Theres a sample there named "listener.d" that shows how to use D sockets.
If you're using DMD2, the listener.d file is broken. You'll have to convert it into D2 yourself.
|
February 25, 2010 Re: Simple Socket Server Code | ||||
---|---|---|---|---|
| ||||
Posted in reply to daoryn | On 02/24/2010 09:00 AM, daoryn wrote:
> Check the "samples" dir inside the dmd instalation folder.
> Theres a sample there named "listener.d" that shows how to use D sockets.
> If you're using DMD2, the listener.d file is broken. You'll have to convert it into D2 yourself.
I actually did look at that and it is more than I was looking for. I just wanted something akin to "Listen -> Accept -> Process -> Respond -> Repeat."
Regardless, it turns out that my understanding was better than I thought. I just had a stupid little bug that I didn't notice was an actual compilation error at first. Guess that's what I get when I try to write code when tired...
Anyway, thanks!
|
Copyright © 1999-2021 by the D Language Foundation