UNIX Domain sockets on HPUX

Ask a Question related to PERL Modules, Design and Development.

  1. #1

    Default UNIX Domain sockets on HPUX

    I'm trying to use UNIX Domain sockets on HPUX 11.11, using Perl 5.6.1 for
    PA-RISC2.0, the IO::Socket module, without much luck.

    I've tried the code in Perl Cookbook, and many modifications. Here's my
    code:

    #!/usr/bin/perl
    use IO::Socket;
    use strict;
    use warnings;

    unlink "/tmp/mysock";
    our $server = IO::Socket::UNIX->new(LocalAddr => "/tmp/mysock",
    Type => SOCK_DGRAM,
    Listen => 5)
    or die $!;

    while (my $client = $server->accept())
    {
    while (defined (my $buf = <$client>))
    {
    print "$buf\n";
    }
    }

    close ($server);

    exit(0);



    When I run it, the ->new() call appears to work. No error codes and the
    debugger reports that $server is a socket. The /tmp/mysock file doesn't
    get created, though.

    Then the while($client = ... ) just falls through. It doesn't wait for
    the socket to say anything, it just skips to the close() statement and
    exits.

    I've done this with INET sockets a number of times with no problems, but
    this is the first time I've tried UNIX sockets.

    I wonder if it might be a HPUX issue. If anyone has any ideas, I'd
    appreciate hearing about them.

    Thanks
    Russ Jones
    Russ Jones Guest

  2. Similar Questions and Discussions

    1. Need help with a simple UNIX sockets server based on IO::Socket::UNIX
      Hi. I've tried to create a simple client + server that communicate through a unix socket. As with all socket servers, it has a loop where it...
    2. sockets on an HPUX (thanks for the port scanner!)
      Thank you Mr. Saffioti for the port-scanning code. I have been playing with some simple network programming scripts recently and your code below is...
    3. sockets on an HPUX
      People of the Perl, does anyone have a perl program that will create a socket ( srwxr-xr-x ) for a HPUX 11.0 system? I am in need of this! I...
    4. Perl sockets on an HPUX
      Great where do I get this IO::Socket module? thank you Derek B. Smith OhioHealth IT UNIX / TSM / EDM Teams
    5. unix domain sockets buffer limitations 4kb
      in aix, the maximum size of the unix domain sockets buffer is limitd to 4kb. and this size is within the limits of the operating system. in case of...
  3. #2

    Default UNIX Domain sockets on HPUX

    I'm trying to use UNIX Domain sockets on HPUX 11.11, using Perl 5.6.1 for
    PA-RISC2.0, the IO::Socket module, without much luck.

    I've tried the code in Perl Cookbook, and many modifications. Here's my
    code:

    #!/usr/bin/perl
    use IO::Socket;
    use strict;
    use warnings;

    unlink "/tmp/mysock";
    our $server = IO::Socket::UNIX->new(LocalAddr => "/tmp/mysock",
    Type => SOCK_DGRAM,
    Listen => 5)
    or die $!;

    while (my $client = $server->accept())
    {
    while (defined (my $buf = <$client>))
    {
    print "$buf\n";
    }
    }

    close ($server);

    exit(0);



    When I run it, the ->new() call appears to work. No error codes and the
    debugger reports that $server is a socket. The /tmp/mysock file doesn't
    get created, though.

    Then the while($client = ... ) just falls through. It doesn't wait for
    the socket to say anything, it just skips to the close() statement and
    exits.

    I've done this with INET sockets a number of times with no problems, but
    this is the first time I've tried UNIX sockets.

    I wonder if it might be a HPUX issue. If anyone has any ideas, I'd
    appreciate hearing about them.

    Thanks
    Russ Jones
    Russ Jones Guest

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139