I'm using irc via telnet to learn more about the raw protocol. Everything runs smoothly except one thing that I find annoying. I need to reply to ping with pong <message from ping> every time the server requests it, otherwise it will disconnect me (ping timeout). Because of this I can't idle out and need to pay attention to ping requests. I'm trying to find some way to still use telnet normally only to make those pong replies more automatic so I can do something else. I tried googling and asking around on irc channels, but to no success so far. Any ideas? I'm connecting from a *nix server.
For you maybe. I'm looking for an answer to the question in op.
Can anyone give me a hint on how to achieve this?
Name:
Anonymous2008-02-02 22:35
>>3
Write a program that connects to the specified address and port, and puts all data it receives on stdout, and sends all data it gets on stdin, except when it receives a server PING message, in which case it doesn't echo to stdout, and silently replies with a PONG.
Name:
Anonymous2008-02-02 22:35
And if you need further hints, look at the netcat source (not the telnet source, that's far too complicated)
Name:
Anonymous2008-02-02 22:37
OP here. Hmmm I was thinking. Maybe writing a script (in Perl or some other language) that would act like telnet would be a good start. Most people seem to concentrate on sending commands to the server through pre-specified strings in the sript itself rather than allowing the user to type whatever the hell he wants. So far I couldn't find anything with google but I'm still searching.
Why? Because you said so? Some idiot who doesn't have any skills himself yet he spams random crap in other people's threads, trying to get flames and negative replies thinking he's the shit? If you don't plan to contribute in any way go somewhere else. Somewhere where you can talk to people on your "level", like /b/. I don't need your advices as to what to do with myself in the future.
//`'''```,'''```,'''```,'''```,'''``
o // HAVE YOU READ YOUR SICP TODAY? `.,
,....OOo. .c;.',,,.'``.,,.``.,,.``.,,.``.,,.``.,,.`
.' ____.,'.//
/ _____ \___/.'
| / || \\---\|
|| || \\ ||
co co co co
Name:
Anonymous2008-02-03 4:42
OK, from various examples, faqs and with a bit of luck I managed to write:
#!/usr/bin/perl
use IO::Socket;
$sock = IO::Socket::INET->new('localhost:6667') or die "can't connect $!";
if (fork()) {
select($sock);
print while <STDIN>; # everything from stdin to socket
} else {
while ($line = <$sock>) {
if ($line =~ /^PING/) {
print $sock "PONG :" . (split(/ :/, $line))[1];
} else {
print $line;
}
}
}
...and it does exactly what I wanted! It's like a normal telnet session to irc only without the annoying ping-pong part. I'm using it now as my irc client.
>>28
No, it's not 'screen irssi' nor 'tcp dump'
It's 'screen', 'irssi' and 'tcpdump'.
I doubt you use them, your terminal would refuse to do what you want if you typed screen irssi or tcp dump.
You call me a tree humping dumb faggot but you are the one who asks trivial questions, posts stupid follow ups and is generally lost.
>No, it's not 'screen irssi' nor 'tcp dump'
I know the gnu screen and I use irssi every day. Even wrote a plugin for it that changes the encoding of messages sent to the server. (before you start your ecudumacated pseudo-smart talk - recode_out_default_charset doesn't do that).
>I doubt you use them
Because you're a tree humping dumb faggot. What you think doesn't matter to anyone.
>your terminal would refuse to do what you want if you typed screen irssi or tcp dump.
Because you said so. Too bad my terminal doesn't care about you either.
>You call me a tree humping dumb faggot but you are the one who asks trivial questions, posts stupid follow ups and is generally lost.
Not so lost any more. I've learned a lot, even through this stupid flame war. I wonder what your next reply is going to look like... perhaps "you probably don't know how to blind type either!"? Try that line, it may be fun. Don't forget to collect some "evidence". Once you're done with the humping that is.
>>31
Hmmm >>30 is not OP (me), fatty. I doubt anyone cares though.
>>32 Even wrote a plugin for it that changes the encoding of messages sent to the server.
Who 'even wrote' a plugin for 'it'?
(before you start your ecudumacated pseudo-smart talk
Perhaps you ment educated pseudo smart talk. (no hyphen)
Because you said so. Too bad my terminal doesn't care about you either.
No, not because I said so, because you don't know how to use your terminal.
Moreover, to further prove my claim, you believe that terminals have feelings, which is ofcourse, false.
Not so lost any more. I've learned a lot, even through this stupid flame war. I wonder what your next reply is going to look like... perhaps "you probably don't know how to blind type either!"? Try that line, it may be fun. Don't forget to collect some "evidence". Once you're done with the humping that is.
I am the one who feels lost now. Blind type? What is that? What evidence are you refering to?
I suggest a therapist.
Name:
Anonymous2008-02-03 11:05
ITT, angry nerds.
Name:
Anonymous2008-02-03 11:50
Who 'even wrote' a plugin for 'it'?
Your mother did.
Perhaps you ment educated pseudo smart talk. (no hyphen)
I intentionally misspelled the word. ...well ok the hyphen wasn't intentional but hell I'm not perfect. I see that you are very desperate. Now you started pointing out typos.
No, not because I said so, because you don't know how to use your terminal.
You are the one who doesn't know how to use the terminal.
you believe that terminals have feelings
I do. prove me wrong.
I am the one who feels lost now.
What a turn of events!
Blind type? What is that?
I meant touch typing.
I suggest a therapist.
I suggest you go fuck yourself.
Name:
Anonymous2008-02-03 11:57
LOL I'm pretty sure >>33 will point out how my reply isn't linked to his post and how I added an additional vertical line to every quote. That's gonna his main tactic for the next post.
What's gonna happen? What attacks is he going to use this time? Is it going to be a short "fuck you", a tl;dr post or no reply at all? No one knows.
Name:
Anonymous2008-02-03 12:02
>>33 Perhaps you ment educated pseudo smart talk. (no hyphen)
You suck at hyphenation. The hyphen was perfectly alright.