summaryrefslogtreecommitdiff
path: root/ext/Socket/Socket.pm
diff options
context:
space:
mode:
Diffstat (limited to 'ext/Socket/Socket.pm')
-rw-r--r--ext/Socket/Socket.pm14
1 files changed, 10 insertions, 4 deletions
diff --git a/ext/Socket/Socket.pm b/ext/Socket/Socket.pm
index 8e6e097c0c..6c63fb5fe3 100644
--- a/ext/Socket/Socket.pm
+++ b/ext/Socket/Socket.pm
@@ -86,10 +86,6 @@ require DynaLoader;
);
sub AUTOLOAD {
- if (@_ > 1) {
- $AutoLoader::AUTOLOAD = $AUTOLOAD;
- goto &AutoLoader::AUTOLOAD;
- }
local($constname);
($constname = $AUTOLOAD) =~ s/.*:://;
$val = constant($constname, @_ ? $_[0] : 0);
@@ -107,6 +103,16 @@ sub AUTOLOAD {
goto &$AUTOLOAD;
}
+
+# pack a sockaddr_in structure for use in bind() calls.
+# (here to hide the 'S n C4 x8' magic from applications)
+sub sockaddr_in{
+ my($af, $port, @quad) = @_;
+ my $pack = 'S n C4 x8'; # lookup $pack from hash using $af?
+ pack($pack, $af, $port, @quad);
+}
+
+
bootstrap Socket;
# Preloaded methods go here. Autoload methods go after __END__, and are