msaouab / ft_irc

Internet Relay Chat

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ft_irc

Internet Relay Chat

Desciption

  • Internet Relay Chator IRC is a text-based communication protocol on the Internet.It offers real-time messaging that can be either public or private. Users can exchangedirect messages and join group channels.IRC clients connect to IRC servers in order to join channels. IRC servers are connected together to form a network.2

Summary:

- This project is about creating your own IRC server.You will use an actual IRC client to connect to your server and test it.
- Internet is ruled by solid standards protocols that allow connected computers to interactwith each other.
- It’s always a good thing to know.Version: 6

Mandatory part

  • We have to develop an IRC server in C++ 98.
  • The server must be capable of handling multiple clients at the same time and never hang.
  • Only 1 poll() (or equivalent) can be used for handling all these operations (read, write, but also listen, and so forth).
  • An IRC client must be able to connect to your server without encountering any error.
  • Communication between client and server has to be done via TCP/IP (v4).
  • Using the IRC client with our server must be similar to using it with any official IRC server. However, we only have to implement the following features:
    • We must be able to authenticate, set a nickname, a username, join a channel, send and receive private messages using the IRC client.
    • All the messages sent from one client to a channel have to be forwarded to every other client that joined the channel.
    • We must have operators and regular users.
    • Then, we have to implement the commands that are specific to operators.

Bonus part

  • Here are the extra features we added to our IRC server so it looks even more like and actual IRC server:
    • Handle file transfer.
    • Add a bot.

Socket();

  • The socket(): function shall create an unbound socket in a communications domain, and return a file descriptor that can be used in later function calls that operate on sockets.

  • The socket() function takes the following arguments:

    • domain: Specifies the communications domain in which a socket is to be created we use AF_INET "Address Family Internet" the socket can communicate using IP addresses 'IPv4'.
    • type: Specifies the type of socket, such as SOCK_STREAM for a reliable, stream-oriented connection or SOCK_DGRAM for a connectionless, datagram-oriented connection.
    • protocol: Specifies a particular protocol to be used with the socket. Specifying a protocol of 0 causes socket() to use an unspecified default protocol appropriate for the requested socket type.

fcntl();

  • fcntl(): is a system call in Unix-like operating systems that is used to manipulate file descriptors. The file descriptor is a unique integer assigned to a file or other input/output (I/O) resource when it is opened. The fcntl function allows a process to change the properties of an open file descriptor, such as making it non-blocking, setting its close-on-exec flag, or changing its access modes.

  • The fcntl function takes three arguments:

    • The file descriptor to be modified.
    • The command to be executed, which is specified as a constant.
    • An optional argument that is specific to the command.

💪 Contributers

Resources

About

Internet Relay Chat


Languages

Language:C++ 97.8%Language:Makefile 2.2%