Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • by yoleg (7730) on 2007.03.07 2:56 (#53533)
    Hello clkao, I am also interested in using Microperl with some networking functions. How did you port the functionalities from Socket.pm to Perl? Did you write them in C? from what I read in your post, you seem to have rewritten in Perl... When you write that it's not such a good thing to do it from perl because it's platform-dependent, does this refer to the CPU type or to the OS itself. My goal is to add some local UNIX socket functionality (sockaddr_un) inside Microperl to be able to accept incoming connections from this socket from a C program. This allows me to send commands via the socket to the main Perl program, that is running as a userspace daemon (rather than spending quite some time to load the Perl interpreter each time, especially because I'm on a embedded platform). Do you still have the code you wrote in early 2006, so that I can try to base my work on this? That would be a great starting point! Thanks...
    • Hello,

      I finally could make it work by using the following code (that allows my code to be rather platform-independant, if I fill in properly the first bunch of variables):

      my $PF_UNIX=1;
      my $AF_UNIX=$PF_UNIX;
      my $SOCK_STREAM=2;   # 1 for ix86, 2 for MIPS
      my $SOMAXCONN=128;
      my $sun_path_SIZE=2;
      my $sun_family_SIZE=108;



      #my $uaddr = sockaddr_un($SOCKFILE);   # Create a UNIX socket (local)... not used because this requires Socket.pm... instead, we will pack the sockaddr_un