Re: what is wrong with my simple socket client?

2013-04-08 Thread Michael

On Sunday, 7 April 2013 at 12:01:15 UTC, halida wrote:

Here is the code:

https://gist.github.com/halida/5330197

I want to learn how to use socket in D,
and use a echo server written in ruby as echo_server.rb,
and I test it with telnet, it works fine.
and I write the client.d,
and the result is not what I expected,
and don't know what is wrong,
So anyone has a clue?

Output is listed at the end of the gist. Thanks for your help.


1. IP address of localhost is 127.0.0.1.
2. You need properly initialized AddressInfo struct.


Re: Opportunity

2013-04-08 Thread Jesse Phillips

On Monday, 8 April 2013 at 14:20:11 UTC, Russel Winder wrote:
Given that the entire C++ standards committee will be at ACCU 
2013, I've
decided to do a lightning talk on why D and Go are better tools 
for any

native coding problem than C++.

pigeon[500] pigeons;
pigeons[random(500)] = new cat;

:-)


That is great. Just remember your audience, they will be looking 
for what C++ can get out of it. You'll want to keep them happy so 
they don't disregard everything (not that they are the type to do 
so, someone will be)


Re: operator +=

2013-04-08 Thread Minas Mina

On Monday, 8 April 2013 at 12:37:34 UTC, Simen Kjaeraas wrote:

On 2013-04-08, 14:23, Minas Mina wrote:


How can I define operator += for a struct?


http://dlang.org/operatoroverloading.html

In short:

struct S {
auto opOpAssign( string op : "+" )( S other ) {
// Do stuff here.
}
}


Thanks a lot.


Opportunity

2013-04-08 Thread Russel Winder
Given that the entire C++ standards committee will be at ACCU 2013, I've
decided to do a lightning talk on why D and Go are better tools for any
native coding problem than C++.

pigeon[500] pigeons;
pigeons[random(500)] = new cat;

:-)
-- 
Russel.
=
Dr Russel Winder  t: +44 20 7585 2200   voip: sip:russel.win...@ekiga.net
41 Buckmaster Roadm: +44 7770 465 077   xmpp: rus...@winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder


signature.asc
Description: This is a digitally signed message part


Re: operator +=

2013-04-08 Thread Simen Kjaeraas

On 2013-04-08, 14:23, Minas Mina wrote:


How can I define operator += for a struct?


http://dlang.org/operatoroverloading.html

In short:

struct S {
auto opOpAssign( string op : "+" )( S other ) {
// Do stuff here.
}
}

--
Simen


operator +=

2013-04-08 Thread Minas Mina

How can I define operator += for a struct?


Re: what is wrong with my simple socket client?

2013-04-08 Thread Andrea Fontana

On Sunday, 7 April 2013 at 12:01:15 UTC, halida wrote:

Here is the code:

https://gist.github.com/halida/5330197

I want to learn how to use socket in D,
and use a echo server written in ruby as echo_server.rb,
and I test it with telnet, it works fine.
and I write the client.d,
and the result is not what I expected,
and don't know what is wrong,
So anyone has a clue?

Output is listed at the end of the gist. Thanks for your help.


What did you expect?