all tasks
This commit is contained in:
parent
b83f433714
commit
68f8f3e56b
14735 changed files with 178959 additions and 0 deletions
13
Task/Sockets/D/sockets.d
Normal file
13
Task/Sockets/D/sockets.d
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
module socket ;
|
||||
import std.stdio ;
|
||||
import std.socket ;
|
||||
version(Win32) {
|
||||
// For Win32 systems, need to link with ws2_32.lib.
|
||||
pragma(lib, "ws2_32.lib") ;
|
||||
}
|
||||
void main() {
|
||||
auto socket = new Socket(AddressFamily.INET, SocketType.STREAM) ;
|
||||
socket.connect(new InternetAddress("localhost",256)) ;
|
||||
writefln(socket.send(cast(void[])"hello socket world"), " bytes sent.") ;
|
||||
socket.close() ;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue