| | |
trouble with sockets...
Please support our Perl advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Sep 2009
Posts: 3
Reputation:
Solved Threads: 0
Perl Syntax (Toggle Plain Text)
#!/usr/local/bin/perl use IO::Socket; my $url = 'localhost'; my $port = 6464; my $error = 1; my $sock ; while ($error) { my $sock = new IO::Socket::INET ( LocalHost => $url, LocalPort => $port, Proto => 'tcp', Listen => 1, Reuse => 1 ); $error = 0 ; $error =1 unless $sock; } print "Listener Port Established \n"; $error =1 ; while ($error) { my $new_sock = $sock->accept(); $error =0 ; $error =1 unless $new_sock; } print "Connection Established \n"; while (<$new_sock>) { print $_; } close($sock);
What I get is:
Listener Port Established
Can't call method "accept" on an undefined value at /usr/mbin/testserv.pl line 27.
Any ideas? RH 8 linux (upgradeing OS is not an option)
![]() |
Similar Threads
- Porting Unix,Linux sockets to windows without winsock (C++)
- Hotmail Access Trouble (Web Browsers)
- tutorial for UNIX sockets (C)
- my win 98 is in trouble (Windows 95 / 98 / Me)
- Trouble opening certain files... (Windows 95 / 98 / Me)
- Trouble installing Pather (OS X)
- sims trouble (Windows NT / 2000 / XP)
- windows XP home sockets error (Windows NT / 2000 / XP)
Other Threads in the Perl Forum
- Previous Thread: substitution regex question
- Next Thread: how to compare two directories that contain xml files in perl??
| Thread Tools | Search this Thread |
Tag cloud for Perl





