---
name: "unixstream"
section: "3cc"
platform: "linux"
package: "libcommoncpp2-dev"
version: "1.0.13-5"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/unixstream"
---

# unixstream(3cc)

A more natural C++ 'unixstream' class for use by non-threaded applications. C++ 'fstream' style unixstream class.

## NAME

unixstream - A more natural C++ 'unixstream' class for use by non-threaded applications. C++ 'fstream' style unixstream class.

## SYNOPSIS

`#include <unix.h>`

Inherits **UnixStream**.

### Public Methods

**unixstream** ()\
 *Construct an unopened 'tcpstream' object.* **unixstream** (const char \*pathname, int buffer=512)\
 *Construct and 'open' (connect) the tcp stream to a remote socket.* **unixstream** (**UnixSocket** &unixsock, int buffer=512)\
 *Construct and 'accept' (connect) the tcp stream through a server.* void **open** (const char \*pathname, int buffer=512)\
 *Open a tcp stream connection.* void **open** (**UnixSocket** &unixsock, int buffer=512)\
 *Open a tcp stream connection by accepting a tcp socket.* void **close** (void)\
 *Close the active tcp stream connection.* bool **operator!** () const\
 *Test to see if stream is open.*

## DETAILED DESCRIPTION

A more natural C++ 'unixstream' class for use by non-threaded applications. C++ 'fstream' style unixstream class.

This class behaves a lot more like fstream and similar classes.

**Author:**  Alex Pavloff \<alex@pavloff.net\>

## CONSTRUCTOR & DESTRUCTOR DOCUMENTATION

### unixstream::unixstream ()

Construct an unopened 'tcpstream' object.

### unixstream::unixstream (const char \* pathname, int buffer = 512)

Construct and 'open' (connect) the tcp stream to a remote socket.

**Parameters:**

- *pathname*

  *pathname to socket file*

- *buffer*

  *size for streaming (optional).*

### unixstream::unixstream (UnixSocket & unixsock, int buffer = 512)

*Construct and 'accept' (connect) the tcp stream through a server.*

**Parameters:**

- *unixsock*

  *socket to accept from.*

- *buffer*

  *size for streaming (optional).*

## MEMBER FUNCTION DOCUMENTATION

### void unixstream::close (void)

*Close the active tcp stream connection.*

### void unixstream::open (UnixSocket & unixsock, int buffer = 512)

*Open a tcp stream connection by accepting a tcp socket.*

**Parameters:**

- *unixsock*

  *socket to accept from.*

- *buffer*

  *size for streaming (optional)*

### void unixstream::open (const char \* pathname, int buffer = 512)` [inline]`

*Open a tcp stream connection.*

*This will close the currently active connection first.*

**Parameters:**

- *pathname*

  *pathname to socket file*

- *buffer*

  *size for streaming (optional)*

### bool unixstream::operator! ()

*Test to see if stream is open.*

*Reimplemented from* **Socket***.*

## AUTHOR

*Generated automatically by Doxygen for CommonC++ from the source code.*
