in reply to Bad arg length for Socket::unpack_sockaddr_in, length is 0, should be 16 at Socket.pm line 780

Could you please help to identify the issue here?

You're not error checking ("or die...")

:) Why not use something slightly higher up the food chain, say IO::Socket, then you can

=head2 $addr = $sock->peerhost Return the numeric form of the peer address as a textual representatio +n =head2 $port = $sock->peerport Return the numeric form of the peer port number
  • Comment on Re: Bad arg length for Socket::unpack_sockaddr_in, length is 0, should be 16 at Socket.pm line 780
  • Download Code

Replies are listed 'Best First'.
Re^2: Bad arg length for Socket::unpack_sockaddr_in, length is 0, should be 16 at Socket.pm line 780
by jobinjoseph121 (Novice) on Sep 10, 2015 at 07:26 UTC
    Hi,

    Thank you for the reply.

    Unfortunately i can not switch to IO::Socket but had to go with Socket option only.
    Can you please suggest any method to correct this issue?

    Thanks and Regards,
    Jobin Joseph

      Unfortunately i can not switch to IO::Socket but had to go with Socket option only. Can you please suggest any method to correct this issue?

      :) IO::Socket is a core module just like Socket -- you can use both

      At the very least try using IO::Socket to see if you can make it work ... then work back to see if you can figure out where you go wrong