Changes between Version 5 and Version 6 of SocketFileCopyExample
- Timestamp:
- 02/17/10 00:18:35 (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
SocketFileCopyExample
v5 v6 13 13 14 14 private import tango.io.Console, 15 tango.io. FileConduit;15 tango.io.device.File; 16 16 17 private import tango.net.ServerSocket, 18 tango.net.SocketConduit; 17 private import tango.net.InternetAddress; 18 19 private import tango.net.device.Socket; 20 19 21 20 22 /******************************************************************************* 36 38 37 39 // copy incoming stream to a local file 38 auto file = new File Conduit ("dumpster.log", FileConduit.WriteCreate);40 auto file = new File ("dumpster.log", File.WriteCreate); 39 41 file.copy(stream).flush.close; 40 42 } 50 52 51 53 // make a connection request to the server 52 auto send = new Socket Conduit;54 auto send = new Socket; 53 55 send.connect (new InternetAddress("localhost", 8080)); 54 56 55 57 // send the specified file 56 send.copy (new File Conduit(args[1])).flush.close;58 send.copy (new File (args[1])).flush.close; 57 59 } 58 60 else