--- Log opened Sat Apr 02 00:00:40 2011 |
00:07 | < celticminstrel> | Argh, so why doesn't it work then... :( |
00:11 | < celticminstrel> | The IP can be a string, right? |
00:13 | < TheWatcher> | http://docs.python.org/library/socket.html#example suggests so |
00:15 | < ToxicFrog> | What IP are you passing? |
00:16 | < ToxicFrog> | (and are you writing an IRC server, perchance?) |
00:16 | < celticminstrel> | No, not writing a server. |
00:17 | < celticminstrel> | Though there was a totally separate project which basically amounts to that. <_< |
00:17 | < ToxicFrog> | Why are you binding to 6667, then? |
00:17 | < celticminstrel> | It's an IRC bot. |
00:17 | < ToxicFrog> | See my earlier question |
00:18 | < ToxicFrog> | If it's a client, you shouldn't need bind at all |
00:18 | < celticminstrel> | I'm aware of this. |
00:18 | | * TheWatcher blink |
00:18 | < ToxicFrog> | And please answer my earlier earlier question |
00:18 | < celticminstrel> | You mean, "what's the IP"? |
00:18 | < ToxicFrog> | Ie, what address are you passing to bind? |
00:18 | < celticminstrel> | It's just a normal IP address... |
00:19 | < ToxicFrog> | Yes, but what the address is is important. |
00:19 | < celticminstrel> | I don't really want to post it in the channel... |
00:20 | < TheWatcher> | In that case, it won't work for bind |
00:20 | < celticminstrel> | ? |
00:20 | < ToxicFrog> | In particular, it'll fail if it doesn't correspond to any interface on the system |
00:20 | < celticminstrel> | I got it from ifconfig output. |
00:21 | < ToxicFrog> | ifconfig on the same system you're running this on? |
00:21 | < celticminstrel> | Yes. |
00:21 | < ToxicFrog> | You're using AF_INET - this is an IPv4, not IPv6 address? |
00:21 | < celticminstrel> | Yes. |
00:22 | < ToxicFrog> | You've checked to make sure that, say, DHCP hasn't changed the address associated with that interface? |
00:22 | < ToxicFrog> | (also, is there a reason you aren't binding to INADDR_ANY?) |
00:23 | < celticminstrel> | Trying to work around the fact that someone got the server's other IP banned. |
00:23 | < celticminstrel> | I don't know how to check that. |
00:23 | < ToxicFrog> | ifconfig again. |
00:24 | < ToxicFrog> | Also, isn't the correct answer "get the erroneous ban lifted"? |
00:24 | < celticminstrel> | To make sure it's still the same IP? Yeah, it is. |
00:24 | < celticminstrel> | I already tried that. They said they can't because it'd also let the other guy back in. |
00:25 | < TheWatcher> | More that this, though, why are you creating a server for a bot? |
00:25 | < celticminstrel> | Um, I'm not. It's a client. :| |
00:26 | < TheWatcher> | If you're calling bind, you're making a server |
00:26 | < ToxicFrog> | TheWatcher: you can in fact use bind() on client sockets. |
00:26 | < ToxicFrog> | This guarantees you know what interface and port the connection is seen to originate from. |
00:26 | < TheWatcher> | Huh, didn't know that. |
00:29 | < ToxicFrog> | connect() on an unbound socket does something like bind(sock, INADDR_ANY, 0) automatically before actually connecting. |
00:30 | < ToxicFrog> | celticminstrel: if this is AF_INET, then (according to bind(2)), "invalid argument" will only happen if the socket is already bound. |
00:30 | < celticminstrel> | Ah. |
00:30 | < celticminstrel> | So, trying a different port could work? |
00:31 | < ToxicFrog> | Assuming that this is EINVAL from the underlying socket layer, not a python "invalid argument" exception, in which case I'd suspect you weren't tuplizing the arguments properly. |
00:31 | < ToxicFrog> | The socket, not the port. |
00:31 | | Kindamoody is now known as Kindamoody[zZz] |
00:31 | < ToxicFrog> | If the port's already in use you'll get EADDRINUSE. |
00:32 | < ToxicFrog> | The typical cause of EINVAL is that you accidentally called bind() twice on the same socket. |
00:32 | < celticminstrel> | No, it said errno 22. |
00:32 | < celticminstrel> | It would unbind once the process terminated, right? |
00:33 | < ToxicFrog> | ...yes, since among other things it should no longer exist once the program exits |
00:34 | < celticminstrel> | Changing ports is irrelevant then? |
00:34 | < ToxicFrog> | Should be, yes. |
00:34 | < ToxicFrog> | Although - why are you specifying 6667? |
00:35 | < celticminstrel> | Only because I know it's the normal IRC port. |
00:35 | < ToxicFrog> | But this is a client socket. |
00:35 | < celticminstrel> | Yes, which is why I wasn't sure that that was right. |
00:37 | < ToxicFrog> | Unless you have a reason for your connection to be seen as originating from a specific port, you should bind to port 0; the OS will automatically assign you a free port in an appropriate range. |
00:37 | < celticminstrel> | Ah, I did not know that, thanks. |
00:38 | < celticminstrel> | Still doesn't work though. |
00:39 | < ToxicFrog> | Well, no, I wouldn't expect it to, since the error it's reporting has nothing to do with the port; I'm just saying that binding to a specific port is bad form and can result in other problems later. |
00:41 | < celticminstrel> | Ooh. Does bind need to be called before connect? |
00:42 | < ToxicFrog> | ...yes. |
00:42 | < ToxicFrog> | As I mentioned earlier, calling connect() on an unbound socket will autobind it. |
00:42 | < celticminstrel> | Well, there's my problem! |
00:42 | < ToxicFrog> | And once a connection is established, even if you could re-bind it, doing so would break the connection. |
00:43 | < celticminstrel> | Thanks. :) |
00:47 | | You're now known as TheWatcher[T-2] |
00:49 | | You're now known as TheWatcher[zZzZ] |
01:09 | | Derakon[AFK] is now known as Derakon |
02:13 | | Derakon is now known as Derakon[AFK] |
02:43 | | Stalker [Z@3A600C.A966FF.5BF32D.8E7ABA] has quit [Ping timeout: 121 seconds] |
05:07 | | celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!] |
05:40 | | kwsn is now known as kwsn\t-2 |
05:41 | | kwsn\t-2 [kwsn@BAD19E.B5A83A.180240.E5184B] has quit [[NS] Quit: moo] |
05:55 | | Kindamoody[zZz] is now known as Kindamoody |
06:01 | | Rhamphoryncus [rhamph@C06FE3.F5723C.BE3FEB.9D4666] has quit [Client exited] |
06:01 | | Kindamoody [Kindamoody@Nightstar-4764665d.tbcn.telia.com] has quit [Connection closed] |
06:02 | | Kindamoody [Kindamoody@Nightstar-4764665d.tbcn.telia.com] has joined #code |
06:09 | | Kindamoody [Kindamoody@Nightstar-4764665d.tbcn.telia.com] has quit [Connection reset by peer] |
06:09 | | Kindamoody [Kindamoody@Nightstar-4764665d.tbcn.telia.com] has joined #code |
06:40 | | cpux [chatzilla@Nightstar-c978de34.dyn.optonline.net] has quit [Ping timeout: 121 seconds] |
06:44 | | shade_of_cpux [chatzilla@510B1D.8D602E.9FE2BE.9FAE21] has joined #code |
06:44 | | shade_of_cpux is now known as cpux |
07:07 | | cpux is now known as shade_of_cpux |
07:12 | | shade_of_cpux [chatzilla@510B1D.8D602E.9FE2BE.9FAE21] has quit [Ping timeout: 121 seconds] |
07:25 | | AnnoDomini [annodomini@D553D1.BC14F9.EA786C.63D8A4] has joined #code |
07:54 | | Derakon[AFK] is now known as Derakon |
08:17 | | Derakon is now known as Derakon[AFK] |
09:13 | | You're now known as TheWatcher] |
09:13 | | You're now known as TheWatcher |
09:26 | | Vornicus is now known as Vornicus-Latens |
10:59 | | Kindamoody is now known as KiMo|food |
11:15 | | KiMo|food [Kindamoody@Nightstar-4764665d.tbcn.telia.com] has quit [Operation timed out] |
11:36 | | Kindamoody [Kindamoody@Nightstar-4764665d.tbcn.telia.com] has joined #code |
11:41 | | KiMo|food [Kindamoody@Nightstar-4764665d.tbcn.telia.com] has joined #code |
11:54 | | Kindamoody [Kindamoody@Nightstar-4764665d.tbcn.telia.com] has quit [Client exited] |
12:20 | | KiMo|food is now known as Kindamoody |
12:45 | | AnnoDomini [annodomini@D553D1.BC14F9.EA786C.63D8A4] has quit [[NS] Quit: leaving] |
15:30 | | Rhamphoryncus [rhamph@C06FE3.F5723C.BE3FEB.9D4666] has joined #code |
15:51 | | celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has joined #code |
16:32 | | celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has quit [[NS] Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.] |
16:38 | | kwsn\t-2 [kwsn@Nightstar-9d744862.dyn.centurytel.net] has joined #code |
16:38 | | kwsn\t-2 is now known as kwns |
16:38 | | kwns is now known as kwsn |
16:50 | | kwsn [kwsn@Nightstar-9d744862.dyn.centurytel.net] has quit [[NS] Quit: ] |
17:18 | | celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has joined #code |
17:27 | | Derakon[AFK] is now known as Derakon |
--- Log closed Sat Apr 02 17:57:20 2011 |
--- Log opened Sat Apr 02 17:58:37 2011 |
17:58 | | TheWatcher [chris@Nightstar-b4529b0c.zen.co.uk] has joined #code |
17:58 | | Irssi: #code: Total of 22 nicks [5 ops, 0 halfops, 0 voices, 17 normal] |
17:59 | | Phox [Tertius_Vulpe@Nightstar-ab4cb40f.abhsia.telus.net] has quit [[NS] Quit: Yeah. Fer serious] |
17:59 | | Irssi: Join to #code was synced in 50 secs |
18:08 | | Kindamoody is now known as Kindamoody|out |
19:19 | | kwsn [kwsn@Nightstar-9d744862.dyn.centurytel.net] has joined #code |
21:42 | | AnnoDomini [annodomini@D553D1.BC14F9.EA786C.63D8A4] has joined #code |
22:02 | | Syloqs-AFH [Syloq@NetworkAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds] |
22:07 | | Syloqs_AFH [Syloq@NetworkAdministrator.Nightstar.Net] has joined #code |
22:08 | | Syloqs_AFH is now known as Syloqs-AFH |
23:48 | | Stalker [Z@3A600C.A966FF.5BF32D.8E7ABA] has joined #code |
--- Log closed Sat Apr 02 23:54:19 2011 |
--- Log opened Sat Apr 02 23:54:48 2011 |
23:54 | | TheWatcher [chris@Nightstar-b4529b0c.zen.co.uk] has joined #code |
23:54 | | Irssi: #code: Total of 24 nicks [5 ops, 0 halfops, 0 voices, 19 normal] |
23:55 | | Irssi: Join to #code was synced in 54 secs |
--- Log closed Sun Apr 03 00:00:36 2011 |