quasi random (kaolinfire) wrote,
quasi random
kaolinfire

If it's good enough for irc?

I've been... programming. more of my time has been diverted towards Neverwinter Nights thank I'd like to admit, but every *thinking* moment has been dedicated to figuring out a robust chat system.

I've been trying to wrap my head around getting real synchronicity and clean threading.

I've been dying to find examples of something done the way I'm doing it. To no avail.

IRC should be a good example of things, right?

But so far as I can tell, IRC is asynchronous in status replies. If you send a command and it doesn't work.... you may well get a "chat" message before getting the "error" message. Unlikely, but possible.

Is this really so horrible? It seems like it should be, my guts wrench... but... IRC is quite successful. It doesn't seem to be such a big deal.

I really want to do right by this system, though -- plain text yet computer decipherable replies are made to EVERY command, whether they worked or not and if not some message explaining why not... just in case such a thing should be trickled up for the enduser to see... so I'm worried about receiving a message inbetween a command being sent out and the reply to that command being returned.

of course, I could just add a state to say "queue messages until reply comes in"... or I could handle such things asynchronously, keeping track of the fact that I was expecting an answer to something and jumping back to that bit of code if/when the reply comes...

what I've been working on, though, is setting up TWO channels of conversation... opening two sockets for each client... and tying them together... it's a little ugly, but... it "feels" right. just not entirely, or I wouldn't be blathering about it here, hoping for a saviour to sweep down and bless me with The Right Way To Do It. Presuming there is a best answer... which is not necessarily a fair assumption.

I should be coding, not whining. I think I'll go to sleep.
Subscribe

  • feedback loops

    Ah, feedback loops. I was kind of out of sorts, yesterday, and for some reason had a lot of diet coke (to try to feel better, though I "knew" it…

  • What would I say?

    What would I say, if I were here? It's 2014, almost 2015—though on and off this year, I've been sure it was 2015. Something about that number. Next…

  • a list of games....

    A friend recently asked for a list of all the games I have available. And I'd made most of this list up a week ago, for someone else, and figured,…

  • Post a new comment

    Error

    default userpic

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 5 comments