Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

irc via telnet, how to auto-pong?

Name: Anonymous 2008-02-02 13:23

Hello.

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.

Name: Anonymous 2008-02-02 13:36

read http://www.faqs.org/rfcs/rfc854.txt
SUDDENLY, THERE IS NO NEED FOR TELNET OR MANUAL PONG!

Name: Anonymous 2008-02-02 22:21

>>2

The document you linked to does not exist.

I think you meant:
http://www.faqs.org/rfcs/rfc1459.html  or
http://www.faqs.org/rfcs/rfc2812.html

I've read them partially already weeks ago.

THERE IS NO NEED FOR TELNET OR MANUAL PONG!

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: Anonymous 2008-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: Anonymous 2008-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: Anonymous 2008-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.

Name: Anonymous 2008-02-02 22:39

>>4

Oh sorry I didn't see your post when I was typing >>6 . Yeah, that sounds like a good idea.

>>5
OK, I'll post the solution here once I find it.

Name: Anonymous 2008-02-02 23:02

Or maybe you could like, USE AN ACTUAL FUCKING IRC CLIENT
</thread>

Name: Anonymous 2008-02-02 23:18

>>8

Or maybe stop learning about protocols and using computers altogether and join you in munching walnuts.

If I wanted to just use IRC I'd run just irssi. I said in op that I want to understand the raw protocol better.

Go troll somewhere else because so far you're worse than pathetic, so is >>2.

Name: Anonymous 2008-02-02 23:24

If you can't even figure out something as trivial as this, don't even bother with learning the protocol (or programming at all for that matter).

Name: Anonymous 2008-02-02 23:47

>>10

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.

Name: Anonymous 2008-02-03 0:24

It's simply the truth, sorry if that offends you.

Name: Anonymous 2008-02-03 0:34

A basic IRC client is trivial to write. Writing one was an exercise in my network programming course (it was a choice between IRC, HTTP, and FTP).

Name: Anonymous 2008-02-03 0:52

>>12

You can stick your "truth" up your ass.

>>13
I'm an amateur Sunday "programmer", not trying to look like anything more or less.

If asking about such a thing in OP looks dumb to must of you sorry for posting such a question.

Anyway, what I wrote so far is:


#!/usr/bin/perl

use IO::Socket;

$sock = IO::Socket::INET->new(
    PeerAddr => 'localhost',
    PeerPort => 6667,
    Proto => 'tcp') or die "could not establish connection";

while ($line = <$sock>) {
    print $line;
    if ($line =~ /^PING/) {
        print $sock "PONG :" . (split(/ :/, $line))[1];
    }
    $command = <>;
    print $sock $command;
}


It's almost what I wanted but I need to press return every time to see the next line the server spews out.

Name: Anonymous 2008-02-03 1:04

No shit, stdin blocks.

Name: Anonymous 2008-02-03 1:07

How do I "unblock" it then?

Name: Anonymous 2008-02-03 1:13

Hmmm I could add something to "trigger" the stdin prompt. Get it to pause the while loop only when I press a special keyboard shortcut or something.

Name: Anonymous 2008-02-03 1:38

looks dumb to must of you sorry for posting such a question.

WHAT

Name: Anonymous 2008-02-03 2:24

                        _    _
                       ( \__//)
                        .'     )
                    __/p q  .  )
                   (_p_`,     .)
                    `--'-,-'  )
                         (.  )
    HAVE YOU READ       (   )
   YOUR PROGRAMMING     (   )
     PERL TODAY?       ( . )         .---.
                      (    )        (     )
                      (   . )      (  .    )
                      (      )    (      .  ),
                      ( .     `"'`  .       `)
                       (      .              .
                       ((  .      .   (   .  
                       ((       .    (       
                        ((     )     _( .   .

Name: Anonymous 2008-02-03 2:36

>>18

*most of you

Name: Anonymous 2008-02-03 3:23

>>19
shutup wooly camel perl

Name: Anonymous 2008-02-03 3:26


                       //`'''```,'''```,'''```,'''```,'''``
             o        // HAVE YOU READ YOUR SICP TODAY?   `.,
       ,....OOo.   .c;.',,,.'``.,,.``.,,.``.,,.``.,,.``.,,.`
    .'      ____.,'.//
   / _____  \___/.' 
  | / ||  \\---\|
  ||  ||   \\  ||
  co  co    co co

Name: Anonymous 2008-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.

>>4 >>5 >>13 >>18 >>19 >>21 >>22

Thanks for posting!

>>2 >>8 >>10 >>12 >>15

Go hump a tree.

Name: Anonymous 2008-02-03 6:14

Kids these days

Name: >>2 2008-02-03 6:23

>>23
No fuck you lame ass motherfucker, real men use screen, irssi and tcpdump.

Name: Anonymous 2008-02-03 6:59

Name: Anonymous 2008-02-03 8:46

>>14
>Anyway, what I wrote so far is:

You wasted your time :)

http://search.cpan.org/dist/POE-Component-IRC/lib/POE/Component/IRC.pm

Name: Anonymous 2008-02-03 9:01

>>25

I do use screen irssi and tcp dump you dumb faggot. Go back to humping your tree.

>>26

Correct. Yes I suck.

>>27

No I didn't. I learned a lot during that time but thanks for the link!

Name: Anonymous 2008-02-03 10:07

>>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.

Name: Anonymous 2008-02-03 10:14

>>29
Obese, unloved.

Name: Anonymous 2008-02-03 10:18

>>30
And what if I am? Does that make you, or your replies for that matter, any less stupid?

Name: Anonymous 2008-02-03 10:43

>>29

>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.

Name: Anonymous 2008-02-03 10:56

>>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: Anonymous 2008-02-03 11:05

ITT, angry nerds.

Name: Anonymous 2008-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: Anonymous 2008-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: Anonymous 2008-02-03 12:02

>>33
Perhaps you ment educated pseudo smart talk. (no hyphen)
You suck at hyphenation. The hyphen was perfectly alright.

Name: Anonymous 2008-02-03 12:19

ITT: NERD RAGE

Name: Anonymous 2008-02-03 18:03

>>36
fuck you

Name: Anonymous 2008-02-03 18:25

I lol'd hard. I bet if you guys met IRL you'd be licking cock by now.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List