diff options
author | xengineering <me@xengineering.eu> | 2022-12-04 13:01:57 +0100 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2022-12-04 13:01:57 +0100 |
commit | a985fb91e9d559f2520633f962028b856631c020 (patch) | |
tree | 2db4d202622552253060a169acfebc742336fbd5 | |
parent | 7162a1018ac8cd64adf85fd30295d662f847e9a8 (diff) | |
download | limox-a985fb91e9d559f2520633f962028b856631c020.tar limox-a985fb91e9d559f2520633f962028b856631c020.tar.zst limox-a985fb91e9d559f2520633f962028b856631c020.zip |
Implement TCP connection to XMPP server
This commit adds the functionality to actually connect to port 5222
(xmpp-client) of a XMPP server! This was tested using prosody and
verified via its systemd journal log entries.
-rw-r--r-- | xmpp.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -124,4 +124,11 @@ void xmpp_connect(void) } else { printf("Got socket number %d from OS.\n", sock); } + + if (connect(sock, addr->ai_addr, addr->ai_addrlen) == -1) { + printf("Failed to connect!\n"); + return; + } else { + printf("Successfully connected.\n"); + } } |