Загрузить файлы в «C»

This commit is contained in:
8nlight 2023-10-06 16:03:43 +03:00
parent bfd92a19b7
commit b0c07cdf38
3 changed files with 16 additions and 25 deletions

View file

@ -1,10 +1,10 @@
#include "irc.h"
//Config
#define HOST "localhost"
#define HOST "irc.rizon.net"
#define PORT 6667
#define NICK "tester134"
char *channels[] = {"#channel"};
char *channels[] = {"#hp"};
#define CHECK_NULL() (client.nick != NULL && client.channel != NULL && client.msg != NULL)
@ -46,16 +46,11 @@ void recvinfo(void) {
int main(void) {
//512 - size of raw buffer (max irc)
IRCC_init(&client, IRCC_MSG_MAX);
IRCC_init(&client);
int status = IRCC_connect(&client, HOST, PORT);
if (status == IRCC_ERROR)
die("Conn refused");
//Socket timeout
struct timeval tv = {IRCC_PING_TIMEOUT, IRCC_PING_TIMEOUT};
if (setsockopt(client.socket, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv)) < 0)
die("setsockopt");
//Register
IRCC_register(&client, NICK);