fix socket_client_open/3

This commit is contained in:
Adrián Arroyo Calle
2022-01-08 23:31:32 +01:00
parent d01806ee2d
commit 07bc97fb31
2 changed files with 5 additions and 4 deletions

View File

@@ -4115,7 +4115,7 @@ impl Machine {
let socket_atom = cell_as_atom!(addr);
let _port = read_heap_cell!(port,
let port = read_heap_cell!(port,
(HeapCellValueTag::Atom, (name, arity)) => {
debug_assert_eq!(arity, 0);
name
@@ -4132,9 +4132,10 @@ impl Machine {
);
let socket_addr = if socket_atom == atom!("") {
atom!("127.0.0.1")
atom!("127.0.0.1:80")
} else {
socket_atom
let buffer = format!("{}:{}", socket_atom.as_str(), port.as_str());
self.machine_st.atom_tbl.build_with(&buffer)
};
let alias = self.machine_st.registers[4];