Posted on 2009-10-13 08:05:28-07 by sakncli
Object member variables?
Hi, I am trying to write a patch for Net-Server package to support IPv6. I thought that using IO-Socket-INET6 as generic IP interface will be clean and useful.

When patching the packet I need to get the LocalAddr, LocalPort and Proto. But I couldn't find any method in IO-Socket-INET6 to get these values.

We provide above values and several additional ones when constructing IO-Socket-INET6 object(via new method). New method calls parent's new and then one of the parent calls IO-Socket-INET6's configure method. Configure method makes a syntax check on some arguments and set some options for the socket. But the problem is, non of the values given as arguments is stored in IO-Socket-INET6 object.

I think, arguments used in object constructor* should be stored in object itself. By this change, users can access socket options via IO-Socket-INET6, they don't have to know internal mechanisms. I think this change will make the package more object oriented.

Sorry if I missed some point.

best regards,


* http://search.cpan.org/dist/IO-Socket-INET6/lib/IO/Socket/INET6.pm#CONSTRUCTOR
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.