in reply to Bind error in script using IO:Socket

bind(S,$this)||die sprintf "(%d)(%s)(%d)(%s) ", $!,$!,$^E,$^E;

Replies are listed 'Best First'.
Re^2: Bind error in script using IO:Socket
by Anonymous Monk on Sep 12, 2009 at 06:21 UTC

    Hi, and thank you.

    I have just tried that and it threw the following error (this time line 72 since I commented out the previous line 71):

    (10049)(Unknown error)(10049)(The requested address is not valid in its context) at C:\Perl\bin\gedcom-crawler.pl line 72.

    I don't believe familysearch.org has changed much. I am still able to retrieve .ged files manually using the same url as in the script (plus family id).

    Thank you, --M

      ...I don't believe familysearch.org has changed much...

      It has nothing to do with familysearch.org. The program is trying to listen on $myHostIP, but $myHostIP doesn't belong to your machine (like you reported, it belongs to your router).

      10049 WSAEADDRNOTAVAIL

      Cannot assign requested address. The requested address is not valid in its context. This normally results from an attempt to bind to an address that is not valid for the local machine. This can also result from connect (Windows Sockets), sendto, WSAConnect, WSAJoinLeaf, or WSASendTo when the remote address or port is not valid for a remote machine (for example, address or port 0).

      After looking at the program, it does a bind() for no reason, so you can just delete that line.

      Actually, I would throw the program away and rewrite it using LWP::Simple, Gedcom, Getopt::Long.

        Thank you, I will try that out. I'm a user, and not a programmer, so perhaps I can get this one to work. I will check out those modules and see if I can understand how to script with them. Thank you, --M