www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Socket Listener and SocketStream

reply Patrick <spam spam.at> writes:
How do I use socketstreams? Any examples out there? (small ones!)
I've checked listener.d which seems to give some clue to sockets overall, but
not enough for me to feel comfortable around them. :(
Mar 19 2007
next sibling parent jb <jon nxbit.net> writes:
Patrick wrote:

 How do I use socketstreams? Any examples out there? (small ones!)
 I've checked listener.d which seems to give some clue to sockets overall,
 but not enough for me to feel comfortable around them. :(

I've been looking for some examples as well to no avail. On a related matter, I've been playing around with listener.d for a while with telnet. For some reason, be it a bug, feature, or just how it's supposed to work, I cannot reconnect to it. Here's what steps I'm taking -I telnet to listener -Listener reports connection -I type whatever, and listener outputs with a byte count -I disconnect (escape key and quit telnet) -Listener reports the disconnect. At this point, if I were to attempt to connect to listener again, the connection is not reported, nor does it display the characters being sent. I've pin-pointed where the problem is, it doesn't get past: foreach(Socket each; reads) { sset.add(each); } the second time through. If anyone knows why this occured or, even better, how to correct this so I can actually reconnect, please post. Thanks, -jb
Apr 17 2007
prev sibling parent Lars Ivar Igesund <larsivar igesund.net> writes:
Patrick wrote:

 How do I use socketstreams? Any examples out there? (small ones!)
 I've checked listener.d which seems to give some clue to sockets overall,
 but not enough for me to feel comfortable around them. :(

Tango has the similar SocketConduit, a few simple examples can be seen here: http://www.dsource.org/projects/tango/wiki/SocketHelloExample and http://www.dsource.org/projects/tango/wiki/SocketFileCopyExample -- Lars Ivar Igesund blog at http://larsivi.net DSource, #d.tango & #D: larsivi Dancing the Tango
Apr 17 2007