Creates a new pipe.
a0tError a0NewPipe( | | | |
| a0tPipe | *pipe, | |
| a0tPort | *port, | |
| int | othernode, | |
| int | tag, | |
| size_t | bufsize, | |
| int | protocol, | |
| int | priority );
| |
Name | rd/wr | Description |
pipe | write | Pipe created. |
port | read | Port to listen or talk. |
othernode | read | Node to connect with. |
tag | read | Tag to use in connection. |
bufsize | read | Size of the communication buffer. |
protocol | read | Protocol of the pipe. |
priority | read | Priority of the pipe. |
This function creates a pipe descriptor to be used in subsequent a0FPut() and a0FGet() functions calls. It must be called in a pair of nodes, creating a connected, point-to-point, buffered communication pipe between these two nodes. One node must specify that the pipe has A0InputPipe in the protocol, the other must specify A0OutputPipe, defining the direction of the communication. The writer node must pass the reader port, the reader node as othernode and a tag. The reader node must specify its port, the writer node as othernode and the same tag.
The buffer size used can be specified in bufsize. The default size is A0DefaultPipeSize. A new thread is created to listen or talk in the pipe, with a priority stated in priority.
protocol is an integer bitmask that contains A0OutputPipe or A0InputPipe, bitwise-ored with one of the following:
To send the contents of the buffer in an A0OutputPipe, even when it is not full, there is a function called a0Flush(). After stop using a pipe, it must be disposed with a0DisposePipe(), which also causes a flush. a0Terminate() does not flush any pipes.
Error Code | Description |
A0Err...Some error occurred. | |
A0ErrOkSuccessful completion. | |
a0DisposePipe() a0FPut() a0FGet() a0IFPut() a0IFGet() a0Flush() a0NewPort()