---
name: "ACE_Streambuf_T"
section: "3"
platform: "linux"
package: "libace-doc"
version: "5.0.7-4"
release: "Debian 2.2 (Potato)"
platforms: ["linux"]
url: "https://new.carta.tech/ACE_Streambuf_T"
---

# ACE\_Streambuf\_T(3)

## NAME

ACE\_Streambuf\_T

## SYNOPSIS

```
#include <ace/IOStream_T.h>
template<class STREAM>
class ACE_Streambuf_T : public ACE_Streambuf
{
  public:
    ACE_Streambuf_T (
        STREAM *peer,
        u_int streambuf_size = ACE_STREAMBUF_SIZE,
        int io_mode = ios::in | ios::out
        );
    virtual ssize_t send (char *buf, ssize_t len);
    virtual ssize_t recv (
        char *buf,
        ssize_t len,
        ACE_Time_Value *tv = NULL
        );
    virtual ssize_t recv (
        char *buf,
        ssize_t len,
        int flags,
        ACE_Time_Value * tv = NULL
        );
    virtual ssize_t recv_n (
        char *buf,
        ssize_t len,
        int flags = 0,
        ACE_Time_Value *tv = NULL
        );
  protected:
    virtual ACE_HANDLE get_handle (void);
    STREAM *peer_;
};
```

## PUBLIC MEMBERS

```
ACE_Streambuf_T (
    STREAM *peer,
    u_int streambuf_size = ACE_STREAMBUF_SIZE,
    int io_mode = ios::in | ios::out
    );
```

We will be given a STREAM by the iostream object which creates us.  See the ACE\_IOStream template for how that works.  Like other streambuf objects, we can be input-only, output-only or both.

```
virtual ssize_t send (char *buf, ssize_t len);
```

```
virtual ssize_t recv (
    char *buf,
    ssize_t len,
    ACE_Time_Value *tv = NULL
    );
```

```
virtual ssize_t recv (
    char *buf,
    ssize_t len,
    int flags,
    ACE_Time_Value * tv = NULL
    );
```

```
virtual ssize_t recv_n (
    char *buf,
    ssize_t len,
    int flags = 0,
    ACE_Time_Value *tv = NULL
    );
```

## PROTECTED MEMBERS

```
virtual ACE_HANDLE get_handle (void);
```

```
STREAM *peer_;
```

This will be our ACE\_SOCK\_Stream or similar object.

## AUTHOR

James CE Johnson jcej@lads.com and Jim Crossley jim@lads.com

## NOTE

This file should not be #included directly by application code. Instead, it should #include "ace/IOStream.h".  That's because we only put some conditional compilations in that file.

## LIBRARY

ace
