Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] One query in using IO::Socket::INET

Expand Messages
  • Sreeram B S
    Bottom-posting ... Sreeram B S wrote: Hi Friends, I am using IO::Socket::INET, to establish a connection to a port and get data from
    Message 1 of 5 , Jun 30, 2005
    • 0 Attachment
      Bottom-posting ...

      Sreeram B S <sreeramabsc@...> wrote:

      Hi Friends,

      I am using IO::Socket::INET, to establish a connection to a port and get data from there. I have used the following:

      my $client = IO::Socket::INET->new(PeerAddr => 'localhost',
      PeerPort => 54000,
      Proto => 'tcp');


      Now, how do I make sure that this connection is well established? How can I know whether there is any error in connection?

      Please comment.

      Thanks, Sreeram


      -------------------------------------------------------

      Hi Friends,

      Here I tried to use "die" like this:

      my $client = IO::Socket::INET->new(PeerAddr => 'localhost',
      PeerPort => 54000,
      Proto => 'tcp')

      or die "Connection failed\n";

      But this too did not work. I am not able to read from the port. For reading, I am using the following method:

      my $line;

      while(defined($line=<$client>)) {

      print("Received: $line\n");

      }

      What could be the error here? Kindly suggest.

      Thanks,

      Sreeram


      __________________________________________________
      Do You Yahoo!?
      Tired of spam? Yahoo! Mail has the best spam protection around
      http://mail.yahoo.com

      [Non-text portions of this message have been removed]



      Unsubscribing info is here: http://help.yahoo.com/help/us/groups/groups-32.html




      ---------------------------------
      YAHOO! GROUPS LINKS


      Visit your group "perl-beginner" on the web.

      To unsubscribe from this group, send an email to:
      perl-beginner-unsubscribe@yahoogroups.com

      Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


      ---------------------------------





      ---------------------------------
      Discover Yahoo!
      Have fun online with music videos, cool games, IM & more. Check it out!

      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.