![]() Self.irc = socket.socket(socket.AF_INET, socket.SOCK_STREAM) Summing up, we get this class (save it as irc.py): import socket Sometimes the IDENT command is neccesary too. We then must use the commands to authenticate with the server: 1 The second argument tells the library to use stream sockets, which are traditionally implemented on the TCP protocol. Socket.AF_INET tells the library to use the network protocol IPv4. To create a socket we use the command: irc = socket.socket(socket.AF_INET, socket.SOCK_STREAM) ![]() The IRC protocol is a layer on top of the IP protocol. But following this tutorial may be a lot simpler ) Authentication is achieved using only a few steps: If you are curious, you could read the entire protocol. The IRC protocol has distinct messages such as PRIVMSG, USER, NICK and JOIN. To communicate with an IRC server, you need to use the IRC protocol.
0 Comments
Leave a Reply. |