www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - std.socket

reply "Alexander Panek" <alexander.panek brainsware.org> writes:
Hello,

I just wanted to try using the socket-class and the linker just fails to  
find the implemention of the winsock-functions. Now I wonder how I can  
'link' my program with the wsock32.dll, where *afaik* the  
winsock-functions are implemented. Anybody got something done with sockets  
before?

<snip>
import std.socket;

int main(char [][] args)
{
	Socket s = new Socket(AddressFamily.INET, SocketType.STREAM);
	
	return 0;
}
</snip>

That`s my little test-program.

Alex

-- 
Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/m2/
Dec 15 2004
next sibling parent "Alexander Panek" <alexander.panek brainsware.org> writes:
Well, I just figured out how it links correct:

dmd <srcfile> WS2_32.lib

:)

-- 
Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/m2/
Dec 15 2004
prev sibling next sibling parent "Carlos Santander B." <csantander619 gmail.com> writes:
"Alexander Panek" <alexander.panek brainsware.org> escribió en el mensaje 
news:opsi2nkmk4y2yy8c brainsware-01.chello.at...
| Hello,
|
| I just wanted to try using the socket-class and the linker just fails to
| find the implemention of the winsock-functions. Now I wonder how I can
| 'link' my program with the wsock32.dll, where *afaik* the
| winsock-functions are implemented. Anybody got something done with sockets
| before?
|
| <snip>
| import std.socket;
|
| int main(char [][] args)
| {
| Socket s = new Socket(AddressFamily.INET, SocketType.STREAM);
|
| return 0;
| }
| </snip>
|
| That`s my little test-program.
|
| Alex
|
| -- 
| Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/m2/

dmd littleTestProgram.d wsock32.lib

-----------------------
Carlos Santander Bernal 
Dec 15 2004
prev sibling parent reply "Alexander Panek" <alexander.panek brainsware.org> writes:
Am Thu, 16 Dec 2004 00:01:24 +0100 schrieb Alexander Panek  
<alexander.panek brainsware.org>:

Got another problem there. I get an Access Violation when I try to read  
 from a SocketStream using a connected socket. Also tried to use the  
sample-code (dmd/samples/d/htmlget.d), but the compiled program also  
prints the same error. What`s wrong there? I just tried to connect to  
"www.google.at" on port 80 and then read the stream.

Alex

-- 
Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/m2/
Dec 15 2004
parent Thomas Kuehne <thomas-dloop kuehne.thisisspam.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alexander Panek schrieb am Thu, 16 Dec 2004 00:28:52 +0100:
 Am Thu, 16 Dec 2004 00:01:24 +0100 schrieb Alexander Panek  
<alexander.panek brainsware.org>:

 Got another problem there. I get an Access Violation when I try to read  
  from a SocketStream using a connected socket. Also tried to use the  
 sample-code (dmd/samples/d/htmlget.d), but the compiled program also  
 prints the same error. What`s wrong there? I just tried to connect to  
 "www.google.at" on port 80 and then read the stream.

AFAK you first have to send a GET, HEAD, ... what ever request before you can read something from a HTTP stream. Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFBwSzT3w+/yD4P9tIRAi48AKCK5lFIWHUXMFUmz+SjixKzyLElKACglCnw LgWAczkbetRDjF9vRkeElHs= =9IVR -----END PGP SIGNATURE-----
Dec 15 2004