File: wvloopback2.h

package info (click to toggle)
wvstreams 4.6.1-5
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 6,972 kB
  • sloc: cpp: 64,200; ansic: 4,154; sh: 4,094; makefile: 545; perl: 402
file content (29 lines) | stat: -rw-r--r-- 907 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* -*- Mode: C++ -*-
 * Worldvisions Weaver Software:
 *   Copyright (C) 1997-2002 Net Integration Technologies, Inc.
 *
 */ 
#ifndef __WVLOOPBACK2_H
#define __WVLOOPBACK2_H

#include "wvfdstream.h"

/**
 * A two-way WvLoopback.  Uses a socketpair() to create two streams that
 * allow you to read() from one everything written to the other and vice
 * versa, even (especially) across a fork() call.
 * 
 * s1 and s2 are changed to point at the pair of streams.  There is no
 * condition in which this function returns without setting s1 and s2 to
 * valid non-NULL streams.
 * 
 * You are responsible for doing WVRELEASE on each of the returned streams.
 * 
 * In case of an error, nonfunctional streams are created and returned, and
 * they have their error codes set appropriately.
 * 
 * See also WvLoopback, WvBufStream.
 */
void wvloopback2(IWvStream *&s1, IWvStream *&s2);

#endif // __WVLOOPBACK2_H