in reply to Re^2: File/Data Streaming over a socket
in thread File/Data Streaming over a socket

It's alot easier to use Net::EasyTCP. Here are a couple of snippets that I posted awhile back Sockets-File-Upload with Net::EasyTCP. It has port passwords, usernames and logons, and is encrypted. Read the Net::EasyTCP docs for details. Now Net::EasyTCP uses IO::Select, so that means if a second client connects, while another is currently uploading, it will have to wait for the first upload to finish.(Remember the forking? This dosn't fork). Net::EasyTCP also has a "refuse connection" list, you can employ if out on the NET and some ipaddress is hacking, but not logging on. You can do something like count logon attempts, then after 10 failures, put them in a @banned-ips list.

Also, when I wrote that snippet, there was a problem with RSA(as mentioned), but the module now has an option to handle this:

my @nocrypt = qw(Crypt::RSA); #too slow, but more secure #my @nocompress = qw(Compress::LZF); #just testing this feature $server = new Net::EasyTCP( host => $host, mode => 'server', port => $port, password => $portpassword, # if asymmetric encryption # use a port password donotencryptwith => \@nocrypt, # donotencrypt => 1,
I have another snippet that implements these ideas at ztk-enchat encrypted server client

I'm not really a human, but I play one on earth. flash japh