www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Problems with Socket on linux

reply 4ybaka <4ybaka gmail.com> writes:
Hi!
I run code like this on linux (Arch and Kubuntu 9.04):
	TcpSocket socket = new TcpSocket(new InternetAddress("www.google.com", 80));
	socket.send("GET /intl/en_ALL/images/logo.gif HTTP/1.0\r\n\r\n");
	SocketStream socketStream = new SocketStream(socket);
	num = socketStream.read(data);
And I always have num=0. socket.localAddress is also zero. For remoteAddress I
have an exception: "Transport endpoint is not connected.". I've tried it run on
Windows XP and all work and all addresses resolved. Also I test equal
functionality on linux with Tango (HttpGet) and all also work. So any idea
what's wrong?
Dec 20 2009
next sibling parent 4ybaka <4ybaka gmail.com> writes:
4ybaka Wrote:

 Hi!
 I run code like this on linux (Arch and Kubuntu 9.04):
 	TcpSocket socket = new TcpSocket(new InternetAddress("www.google.com", 80));
 	socket.send("GET /intl/en_ALL/images/logo.gif HTTP/1.0\r\n\r\n");
 	SocketStream socketStream = new SocketStream(socket);
 	num = socketStream.read(data);
 And I always have num=0. socket.localAddress is also zero. For remoteAddress I
have an exception: "Transport endpoint is not connected.". I've tried it run on
Windows XP and all work and all addresses resolved. Also I test equal
functionality on linux with Tango (HttpGet) and all also work. So any idea
what's wrong?
Sorry, I forget. I used dmd 2.037
Dec 20 2009
prev sibling parent Walter Bright <newshound1 digitalmars.com> writes:
4ybaka wrote:
 Hi! I run code like this on linux (Arch and Kubuntu 9.04): TcpSocket
 socket = new TcpSocket(new InternetAddress("www.google.com", 80)); 
 socket.send("GET /intl/en_ALL/images/logo.gif HTTP/1.0\r\n\r\n"); 
 SocketStream socketStream = new SocketStream(socket); num =
 socketStream.read(data); And I always have num=0. socket.localAddress
 is also zero. For remoteAddress I have an exception: "Transport
 endpoint is not connected.". I've tried it run on Windows XP and all
 work and all addresses resolved. Also I test equal functionality on
 linux with Tango (HttpGet) and all also work. So any idea what's
 wrong?
No, but if you figure it out, can you please post a patch? Also, can you post this to bugzilla, please?
Dec 23 2009