diff options
| author | xengineering <me@xengineering.eu> | 2022-12-04 12:57:01 +0100 | 
|---|---|---|
| committer | xengineering <me@xengineering.eu> | 2022-12-04 12:57:01 +0100 | 
| commit | 7162a1018ac8cd64adf85fd30295d662f847e9a8 (patch) | |
| tree | aea4262d8cfc667ff25ede94abca7509c9c5ad06 | |
| parent | 0de21ec65f3c28f2acc947c00c3cb26dc9ea4ecd (diff) | |
| download | limox-7162a1018ac8cd64adf85fd30295d662f847e9a8.tar limox-7162a1018ac8cd64adf85fd30295d662f847e9a8.tar.zst limox-7162a1018ac8cd64adf85fd30295d662f847e9a8.zip | |
Implement socket creation
The socket is needed for the TCP connection to the XMPP server.
| -rw-r--r-- | xmpp.c | 10 | 
1 files changed, 9 insertions, 1 deletions
| @@ -115,5 +115,13 @@ void xmpp_connect(void)  	char *domain = get_domainpart(jid);  	printf("Domainpart is '%s'.\n", domain); -	get_addrinfo(domain); +	struct addrinfo *addr = get_addrinfo(domain); + +	int sock = socket(addr->ai_family, addr->ai_socktype, addr->ai_protocol); +	if (sock == -1) { +		printf("Failed to get socket from OS!."); +		return; +	} else { +		printf("Got socket number %d from OS.\n", sock); +	}  } | 
