Advertisement
Guest User

Untitled

a guest
Sep 10th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
D 0.43 KB | None | 0 0
  1. import std.stdio;
  2. import std.socket;
  3. import std.conv;
  4.  
  5.  
  6. Socket buildSocket()
  7. {
  8.     Socket rawSock = new Socket(AddressFamily.INET,
  9.                                 SocketType.RAW,
  10.                                 ProtocolType.TCP);
  11.  
  12.  
  13.     return rawSock;
  14. }
  15.  
  16.  
  17. void main()
  18. {
  19.     auto rawSock = buildSocket();
  20.     auto buf = new void[65656];
  21.     auto got = rawSock.receive(buf);
  22.  
  23.     write(buf[0 .. got]);
  24.  
  25.     writeln();
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement