Why does the irc protocol implement ping/pong




















The output looks something like Figure Figure The IRC protocol is asynchronous , consisting of a series of events about which you are notified. All these events come through on the same connection, line by line regardless of their content; messages from one channel are interleaved with those of another channel, private messages, server notices, and more.

If you wish the server to send you a list of names on a channel, the server will happily oblige. However, the data will be sent like any other data. If you want to interpret the data and include it in, say, a user list in the IRC client you're programming or perhaps a user list for a channel bot , you will need to set it up to expect that data.

The data must be received one line at a time and be redirected to some sort of data structure that will hold it until the list is complete. You cannot simply request the list and expect that its content will immediately follow. Some other data might come through first, or there might be a channel message in the middle of the list.

Furthermore, the IRC server will not confirm your actions. If you send a message to a channel, you can only assume that it made it to the channel.

The IRC server will not send anything in reply if it did. Therefore, if you're programming some sort of IRC client, you can only assume that whatever you type is going through and display it on screen. If you ask to join a channel, you cannot assume that you have joined it until the server tells you so. This asynchronous nature makes it possible for IRC servers to force IRC clients to join a particular channel, as most IRC clients will be unaware that they haven't actually asked to join that channel.

Abstract The IRC Internet Relay Chat protocol is for use with text based conferencing; the simplest client being any socket program capable of connecting to the server. Table of Contents 1. Message Details Optional features Current implementations Current problems Current support and availability Author's Address Full Copyright Statement Labels This section defines the identifiers used for the various components of the IRC protocol.

See the protocol grammar rules section 2. While the maximum length is limited to nine characters, clients SHOULD accept longer strings as they may become used in future evolutions of the protocol. Although the powers granted to an operator can be considered as 'dangerous', they are nonetheless often necessary. In recognition of this need, the protocol discussed herein provides for operators only to be able to perform such functions.

See sections 3. A more controversial power of operators is the ability to remove a user from the connected network by 'force', i. The justification for this is very delicate since its abuse is both destructive and annoying, and its benefits close to inexistent. For further details on this type of action, see section 3. As for users, the nickname has a maximum length of nine 9 characters.

Space is used as parameter separator and command is used as a list item separator by the protocol. A colon ':' can also be used as a delimiter for the channel mask.

Channel names are case insensitive. Each prefix characterizes a different channel type. The definition of the channel types is not relevant to the client-server protocol and thus it is beyond the scope of this document.

The protocol is based on a set of codes which are composed of eight 8 bits, making up an octet. Each message may be composed of any number of these octets; however, some octet values are used for control codes, which act as message delimiters. Regardless of being an 8-bit protocol, the delimiters and keywords are such that protocol is mostly usable from US-ASCII terminal and a telnet connection.

This is a critical issue when determining the equivalence of two nicknames or channel names. If the message contains a valid command, as described in later sections, the client should expect a reply as specified but it is not advised to wait forever for the reply; client to server and server to server communication is essentially asynchronous by nature.

The prefix is used by servers to indicate the true origin of the message. If the prefix is missing from the message, it is assumed to have originated from the connection from which it was received from. Thus, there are characters maximum allowed for the command and its parameters.

There is no provision for continuation of message lines. See section 6 for more details about current implementations. The current solution is to designate two characters, CR and LF, as message separators. Empty messages are silently ignored, which permits use of the sequence CR-LF between messages without extra problems.

Therefore, NUL is not allowed within messages. Most protocol messages specify additional semantics and syntax for the extracted parameter strings dictated by their position in the list. This is a limitation of the protocol as internet hostnames in particular can be longer. Such restriction is necessary because IRC messages are limited to characters in length.

Clients connecting from a host which name is longer than 63 characters are registered using the host numeric address instead of the host name. The most common reply is the numeric reply, used for both errors and normal replies. The numeric reply MUST be sent as one message consisting of the sender prefix, the three-digit numeric, and the target of the reply. A numeric reply is not allowed to originate from a client.

In all other respects, a numeric reply is just like a normal message, except that the keyword is made up of 3 numeric digits rather than a string of letters. A list of different replies is supplied in section 5 Replies. For string matching purposes, the protocol allows the use of two special characters: '?

Message Details On the following pages there are descriptions of each message recognized by the IRC server and client. All commands described in this section MUST be implemented by any server for this protocol. The server to which a client is connected is required to parse the complete message, and return any appropriate errors. In the case of incorrect messages which use parameter lists with comma as an item separator, a reply MUST be sent for each item.

Pass message 2. Nick message 2. Service message 3. The reply message MUST contain the full client identifier upon which it was registered. The optional password can and MUST be set before any attempt to register the connection is made. This parameter is a bitmask, with only 2 bits having any signification: if the bit 2 is set, the user mode 'w' will be set and if the bit 3 is set, the user mode 'i' will be set.

See Section 3. Upon success, the user will receive a MODE message see section 3. If no other parameter is given, then the server will return the current settings for the nick. Lightness Races in Orbit Lightness Races in Orbit k 70 70 gold badges silver badges bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook.

Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Does ES6 make JavaScript frameworks obsolete? Podcast Do polyglots have an edge when it comes to mastering programming Featured on Meta.

Now live: A fully responsive profile. Related 1. Hot Network Questions. Question feed.



0コメント

  • 1000 / 1000