Thread overview | |||||
---|---|---|---|---|---|
|
May 03, 2010 D 2.0 Sockets | ||||
---|---|---|---|---|
| ||||
Hello all, A friend and I recently attempted to write a simple bidirectional networking (eg. chat) application in D 2.0. We ran into some trouble, and as this was the first time we had dealt with sockets we struggled with it quite a bit. We then tried very similar code in Java (in case of an error in the D2 libraries, possibly), we didn't have much trouble at all getting it up and running. The problems we encountered in D2, as best as I can remember them, were (a) enabling blocking on sockets did not seem to work, and (b) sending packets back from client to server caused the server to receive either nothing or an empty packet (I don't remember). So here is my request: Could someone with some experience in sockets more-or-less-translate the following C code into a very simple D2 example with similar functionality? (As I said, it might turn out to be a library problem, though I couldn't find any messages or bug reports about it.) Thanks in advance. http://www.linuxhowtos.org/data/6/server.c http://www.linuxhowtos.org/data/6/client.c (from http://www.linuxhowtos.org/C_C++/socket.htm) |
May 03, 2010 Re: D 2.0 Sockets | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kai Ninomiya | Kai Ninomiya wrote: > Hello all, > > A friend and I recently attempted to write a simple bidirectional networking (eg. chat) application in D 2.0. We ran into some trouble, and as this was the first time we had dealt with sockets we struggled with it quite a bit. We then tried very similar code in Java (in case of an error in the D2 libraries, possibly), we didn't have much trouble at all getting it up and running. If you're using Linux, then you're probably running into this issue: http://d.puremagic.com/issues/show_bug.cgi?id=2835 |
May 04, 2010 Re: D 2.0 Sockets | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jesse Phillips | On 5/3/2010 10:15 AM, Jesse Phillips wrote:
> If you're using Linux, then you're probably running into this issue:
>
> http://d.puremagic.com/issues/show_bug.cgi?id=2835
>
Both of us were using both Windows and Linux at different times, and we both tested locally. I will look into this bug/patch further though, in case it is related.
Thanks.
|
Copyright © 1999-2021 by the D Language Foundation