Re: Adding a GUI

new topic     » goto parent     » topic index » view thread      » older message » newer message
katsmeow said...
irv said...

Next, Kat's program has a hard-coded server name (one of several available, which you could change by editing code).

It's a worse situation than that. What if the user needs to add/delete servers?

And then there's the protocol issue of connecting. See the line " addr_ips = addrinfo[3] for irc.freenode.net, this could be a dozen ips to choose from " ( I didn't chose this idiot markup language )

When you connect to any network at "irc.networkname.ext", they reply with one or more server names. You are expected to parse the list and run thru the list until you connect to one. I removed that intelligence from the client to make irc.e. Ideally, those names should be used to auto-populate the menu of servers which client can connect to, for the case where people prefer to be on the same server (lan parties, for instance), and that's a client-gui thing. So anyhow, i hardcoded a server name to prove the code connects, and the user of irc.e is expected to override with their own list of networks and/or servers.

Strictly speaking, per what i have been told over and over on this forum, the whole procedure at_connected() should be removed, as well as the abbreviated handling of raw numeric 376 (the end of MOTD), because all that is not the connection, it's the protocol of using the connection, and should be in the client. But it's part of the slippery slope of handling the keep-alive and PING-PONG. It's extremely frustrating trying to make the code do less.

I'll be first to admit that everything I know about IRC will fit in this box: []
After downloading an trying a couple of IRC clients, I'm content to leave it that way. Too much like the old party-line phones we had when I was a kid, except back then, we didn't shout out every time we entered or left a room. People could that see for themselves, ifn' they was interested.

As for adding/deleting servers, the code to do that is pretty simple. Just a few more (dozen) lines. Can't code it if I don't know you need it.

Anyway, even if you want to use a stand-alone server, using sockets or shared memory to transfer data back and forth, then the same things need to be taken into account: you can't wait for the data to be available, you'll have to put some "check to see if the socket is ready" code into the GUI client, and call that check via a timer, just as the demo called the listen() function.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu