sitelogo
receive/2

Reads a Minerva term transmitted over a binary stream

receive(+Stream, ?Term)

receive/2 reads a Minerva term from a binary input stream. The term has to be transmitted with send/2.

Arguments

Stream             binary output stream
Term               term

Examples

main(_) :-
    ...
    client_start(localhost, 1352, Socket),
    open(Socket, read, Input, [socket,buffered,binary]),
    open(Socket, write, Output, [socket,buffered,binary]),
    send(Output, SomeRequest),
    receive(Input, SomeAnswer),
    ...

See also

server_start/4, server_stop/1, client_start/3, client_stop/1, listener_start/3, listener_stop/1, send/2, receive/2.


Up read on...
scroll to top managed with ubiCMS