File containing the IRC_Connection struct and related functions. More...
Go to the source code of this file.
Data Structures | |
struct | IRC_Connection |
IRC_Connection struct holds the socket handle, receiving buffer and basic info about the connection. More... | |
Macros | |
#define | INVALID_SOCKET ((SOCKET)(~0)) |
#define | SOCKET_ERROR (-1) |
Typedefs | |
typedef int | SOCKET |
typedef struct IRC_Connection | IRC_Connection |
IRC_Connection struct holds the socket handle, receiving buffer and basic info about the connection. More... | |
Functions | |
IRC_Connection * | connection_create (const char address[], const char port[]) |
"Constructor" for IRC_Connection. More... | |
int | connection_connect (IRC_Connection *connection) |
Actually connect to the remote server specified in connection_create() . More... | |
int | connection_send (IRC_Connection *connection, const char msg[]) |
Send data (char) to remote server. More... | |
int | connection_read (IRC_Connection *connection) |
Receive data from remote server. More... | |
int | connection_disconnect (IRC_Connection *connection) |
Disconnect from remote server and close the socket. More... | |
File containing the IRC_Connection struct and related functions.
typedef struct IRC_Connection IRC_Connection |
IRC_Connection struct holds the socket handle, receiving buffer and basic info about the connection.
int connection_connect | ( | IRC_Connection * | connection | ) |
Actually connect to the remote server specified in connection_create()
.
connection | a pointer to IRC_Connection object |
IRC_Connection* connection_create | ( | const char | address[], |
const char | port[] | ||
) |
"Constructor" for IRC_Connection.
The preferred way to create new connections.
address | a string with the server's URI |
port | a string with the port to be used |
int connection_disconnect | ( | IRC_Connection * | connection | ) |
Disconnect from remote server and close the socket.
connection | a pointer to IRC_Connection object |
int connection_read | ( | IRC_Connection * | connection | ) |
Receive data from remote server.
connection | a pointer to IRC_Connection object |
int connection_send | ( | IRC_Connection * | connection, |
const char | msg[] | ||
) |
Send data (char) to remote server.
connection | a pointer to IRC_Connection object |
msg | data to be sent |