Go to the first, previous, next, last section, table of contents.
Author(s): Jesús Correas.
Version: 1.8#2 (2002/6/14, 18:55:4 CEST)
This module defines a low level socket interface, to be used by javart and jtopl. Includes all the code related directly to the handling of sockets. This library should not be used by any user program, because is a very low-level connection to Java. Use
javart
(Prolog to Java low-level interface) or
jtopl
(Java to Prolog interface) libraries instead.
- Library usage:
:- use_module(library(javasock)).
- Exports:
- Predicates:
start_socket_interface/2
,
stop_socket_interface/0
,
join_socket_interface/0
,
java_query/2
,
java_response/2
,
prolog_query/2
,
prolog_response/2
,
java_stream/4
,
java_debug/1
.
- Other modules used:
- System library modules:
fastrw
,
read
,
sockets/sockets
,
dynamic
,
format
,
concurrency/concurrency
,
javall/jtopl
.
- PREDICATE: start_socket_interface/2:
-
Usage: start_socket_interface(+Address,+Stream)
- Description: Given an address in format 'node:port', creates the sockets to connect to the java process, and starts the threads needed to handle the connection.
- Call and exit should be compatible with:
+Address
is any term.
(basic_props:term/1
)
+Stream
is an open stream.
(streams_basic:stream/1
)
- PREDICATE: stop_socket_interface/0:
-
Usage:
- Description: Closes the sockets to disconnect from the java process, and waits until the threads that handle the connection terminate.
- PREDICATE: join_socket_interface/0:
-
Usage:
- Description: Waits until the threads that handle the connection terminate.
- PREDICATE: java_query/2:
-
The predicate is of type concurrent.
Usage: java_query(ThreadId,Query)
- Description: Data predicate containing the queries to be sent to Java. First argument is the Prolog thread Id, and second argument is the query to send to Java.
- Call and exit should be compatible with:
ThreadId
is an atom.
(basic_props:atm/1
)
Query
is any term.
(basic_props:term/1
)
- PREDICATE: java_response/2:
-
The predicate is of type concurrent.
Usage: java_response(Id,Response)
- Description: Data predicate that stores the responses to requests received from Java. First argument corresponds to the Prolog thread Id; second argument corresponds to the response itself.
- Call and exit should be compatible with:
Id
is an atom.
(basic_props:atm/1
)
Response
is any term.
(basic_props:term/1
)
- PREDICATE: prolog_query/2:
-
The predicate is of type concurrent.
Usage: prolog_query(Id,Query)
- Description: Data predicate that keeps a queue of the queries requested to Prolog side from Java side.
- Call and exit should be compatible with:
Id
is an integer.
(basic_props:int/1
)
Query
is any term.
(basic_props:term/1
)
- PREDICATE: prolog_response/2:
-
The predicate is of type concurrent.
Usage: prolog_response(Id,Response)
- Description: Data predicate that keeps a queue of the responses to queries requested to Prolog side from Java side.
- Call and exit should be compatible with:
Id
is an integer.
(basic_props:int/1
)
Response
is any term.
(basic_props:term/1
)
- PREDICATE: java_stream/4:
-
The predicate is of type data.
Usage: java_stream(PJStream,JPStream,Address,Stream)
- Description: Stores the identifiers of the streams used. A fact is asserted when the connection to the Java process is established. It Contains prolog-to-java and java-to-prolog streams, and the network address where the Java process is running. Last argument represents the Java process standard input stream.
- Call and exit should be compatible with:
PJStream
is a compound term.
(basic_props:struct/1
)
JPStream
is a compound term.
(basic_props:struct/1
)
Address
is a valid host name.
(javasock:machine_name/1
)
Stream
is an open stream.
(streams_basic:stream/1
)
- PREDICATE: java_debug/1:
-
No further documentation available for this predicate.
Go to the first, previous, next, last section, table of contents.