2

Working on own IRC Client and have some questions.

When I join a channel, I get multiple responses from IRC server after I have sent the JOIN command. They occur in this order:

-Server repeats/verifies JOIN command

-Server sends channel topic

-Server sends list of users in the joined channel (which can sometime be sent in chunks, due to message size limitation on IRC).

First question: is that flow correct?

Second question: Am I guaranteed that server will send everything needed before more commands are sent. (e.g. If I JOIN a channel, then someone happens to send a PRIVMSG before the complete JOIN response is completed, will server finish the JOIN before sending the PRIVMSG)

I hope that makes sense! Thanks

DookieMan
  • 992
  • 3
  • 10
  • 26

2 Answers2

1

First question: is that flow correct?

Yes. For JOIN command, server will send the following three responses.

Response 1: :<UserJID> JOIN :<ChannelName>
Response 2: :<Domain> <[RPL_TOPIC][1]> <NickName> <ChannelName> :<Topic>
Response 3:
:<Domain> <[RPL_NAMREPLY][1]> <NickName> = <ChannelName> : <NameList> :<Domain> <[RPL_ENDOFNAMES][1]> <NickName> <ChannelName> :End of Names list

Second question: Am I guaranteed that server will send everything needed before more commands are sent. (e.g. If I JOIN a channel, then someone happens to send a PRIVMSG before the complete JOIN response is completed, will server finish the JOIN before sending the PRIVMSG)

Yes we can be sure. Before completing the JOIN process, server should not send any messages to that channel.

PS: Sending Response 3 is must in some clients to complete a JOIN command process whereas some clients will proceed with 1 and 2 alone.

jab
  • 396
  • 3
  • 15
0

Yes you should always get the JOIN from the server before any other channel events like PRIVMSG.

TingPing
  • 2,129
  • 1
  • 12
  • 15