Get type of socket from addrs enumeration

This commit is contained in:
oupson 2023-02-27 08:28:19 +01:00
parent 765cbb36ec
commit 53bc8e3815
Signed by: oupson
GPG Key ID: 3BD88615552EFCB7
1 changed files with 3 additions and 2 deletions

View File

@ -52,9 +52,10 @@ namespace Footerm {
}
private void connect_to_server() throws GLib.IOError, GLib.Error {
this.socket = new Socket (SocketFamily.IPV4, SocketType.STREAM, SocketProtocol.TCP);
var addrs = new NetworkAddress(this.server.hostname, this.server.port);
socket.connect(addrs.enumerate().next(), null);
var addr = addrs.enumerate().next();
this.socket = new Socket (addr.get_family(), SocketType.STREAM, SocketProtocol.TCP);
socket.connect(addr, null);
var sock = socket.get_fd(); // TODO