in reply to FIle transfer using sockets
First of all PeerPort on client side doesn't match LocalPort on server side, so client can't connect to server.
In order to read file name you should use $file1=<$conn>.
You're reading the whole file into memory before send it to client. That's not a good idea. You'd better use the loop like this:
This would help if you plan to send file which doesn't fit into memory.while (sysread FILE, my $buffer, 4096) { $conn->send($buffer); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: FIle transfer using sockets
by ikegami (Patriarch) on May 10, 2009 at 04:25 UTC | |
by zwon (Abbot) on May 10, 2009 at 08:15 UTC | |
by ig (Vicar) on May 10, 2009 at 09:45 UTC |