![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how do I make my workstation an installation server for a remote server?. | calsum | SUN Solaris | 3 | 04-18-2008 04:54 PM |
| multiple case | micromicrin | Shell Programming and Scripting | 2 | 09-17-2007 03:53 AM |
| how to make case insensitive checks???? | hitmansilentass | Shell Programming and Scripting | 5 | 04-30-2007 03:23 PM |
| close_wait connections causing a server to hung | hariza | UNIX for Advanced & Expert Users | 3 | 10-06-2006 09:35 AM |
| dsl connections lost when attempting to retrieve mail from my server. | norsk hedensk | UNIX for Dummies Questions & Answers | 6 | 12-10-2002 05:14 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
How do I make multiple connections to the server in this case
Given the following code
Code:
#!/usr/bin/perl -w
use IO::Socket;
my($handle, $line, $kidpid);
$handle = IO::Socket::INET->new(
PeerAddr =>"64.22.229.139",
PeerPort =>"4321",
Proto=>"tcp",
)
or die "cant connect to port: $!";
$handle->autoflush(1);
die "can't fork: $!" unless defined($kidpid = fork());
if($kidpid) {
while(defined($line = <$handle>)){
print STDOUT $line;
}
kill("TERM", $kidpid);
}
else {
while(defined ($line = <STDIN>)){
print $handle $line;
}
}
Thanks in advance |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|