Note: The archives category content is an automatically generated focus channel and does not neccessarily reflect the opinions of this blog. No responsibility is taken for the external links presented here, follow at your own discretion.
The archives content is never scraped from sites - but an abstract obtained from search engines.
| Problem |
Solution |
Example |
Reference |
Recommended |
Another use bit of socket programming, courtesy of Perl! Extremely useful bit of Perl, which can be used with the other post on this site, to confirm network connectivity (port scanner). This code (see example tab) will listen on a port (although be careful it is over 1024, unless you are running as root/admin).
|
|
| Problem |
Solution |
Example |
Reference |
Recommended |
perl -MIO::Socket -e '$srv=IO::Socket::INET-> new(LocalPort=>$ARGV[0],Type=>SOCK_STREAM,Reuse=>1,Listen=>5) or die "Failed trying to listen on $ARGV[0]\n";while($cl=$srv->accept()) { while() { print } } close($socket);' port Can also use it as a cheap chat service! Everything gets echo'd through - so just telnet host port and type away! Also see my port scan code at the reference tab.
|
Leave a Reply
June 5th, 2007 at 8:28 pm
[…] Perl Coding School ยป Listen on port - client server demo (tags: Perl Socket Network Programming Port Listener Client Server demo Coding School) Subscribe to techie blogs central by Email […]