www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - UnixSocket

reply "Shadow_exe" <shadow_exe ukr.net> writes:
module test;

import	std.conv,
	std.stdio,
	std.stdint,
	std.socket;

void main(){
	auto _masterSock = new TcpSocket(AddressFamily.UNIX);
}

When you compile everything is fine, but that's when you start 
writing the following:


std.socket.SocketOSException std/socket.d(164): Unable to create 
socket: Protocol not supported
----------------
./test(std.socket.TcpSocket 
std.socket.TcpSocket.__ctor(std.socket.AddressFamily)+0x15) 
[0x807cb05]
./test(_Dmain+0x15) [0x8071199]
./test(extern (C) int rt.dmain2.main(int, char**).void 
runMain()+0x14) [0x8077530]
./test(extern (C) int rt.dmain2.main(int, char**).void 
tryExec(scope void delegate())+0x18) [0x8077040]
./test(extern (C) int rt.dmain2.main(int, char**).void 
runAll()+0x32) [0x8077572]
./test(extern (C) int rt.dmain2.main(int, char**).void 
tryExec(scope void delegate())+0x18) [0x8077040]
./test(main+0x94) [0x8076ff4]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(__libc_start_main+0xe6) 
[0xb760ae46]
./test() [0x80710d1]
----------------

OS:


2012 i686 GNU/Linux



He writes that is not supported, but why??
May 12 2012
parent reply mta`chrono <chrono mta-international.net> writes:
Am 12.05.2012 19:32, schrieb Shadow_exe:
 He writes that is not supported, but why??
Maybe you shouldn't try using a TcpSocket for opening a UNIX socket. auto socket = new Socket(AddressFamily.UNIX, SocketType.STREAM);
May 12 2012
parent "Shadow_exe" <shadow_exe ukr.net> writes:
Yes, you're right, thank you!


On Saturday, 12 May 2012 at 18:20:12 UTC, mta`chrono wrote:
 Am 12.05.2012 19:32, schrieb Shadow_exe:
 He writes that is not supported, but why??
Maybe you shouldn't try using a TcpSocket for opening a UNIX socket. auto socket = new Socket(AddressFamily.UNIX, SocketType.STREAM);
May 12 2012