-
I just tried the example echo server and it gave me an instantiation error. So i tried the equivalent of the first few lines and got some odd behaviour:
I'm not sure what |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
The ?- socket_server_open('127.0.0.1':8001, ServerSocket), socket_server_accept(ServerSocket, Client, Stream, []).
% This will wait here until a connection to the server is made. I acessed the address
% and port in my browser, and then the variables Client and Stream are instantiated as
% follows:
ServerSocket = , Client = '127.0.0.1:59292', Stream = '$stream'(0x55f49f47e498). In the second query you are making with
|
Beta Was this translation helpful? Give feedback.
-
In addition to the observations that @bakaq mentioned, this also indicates mistakes with the current socket predicates, I have filed #2221 and #2222 for them, thank you a lot for reporting this! |
Beta Was this translation helpful? Give feedback.
The
SeverSocket
is to be used insocket_server_accept/4
to get an actual stream that you can use to get and send data. It is also used insocket_server_close/1
to close a socket. For example:In the second query you are making with
format/2
, the reason there is an instantiation error is because the variablesA…