File: mongoc_socket_send.rst

package info (click to toggle)
mongo-c-driver 1.17.6-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 37,256 kB
  • sloc: ansic: 152,613; javascript: 7,954; python: 3,259; sh: 138; makefile: 29; xml: 10
file content (34 lines) | stat: -rw-r--r-- 900 bytes parent folder | download | duplicates (5)
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
30
31
32
33
34
:man_page: mongoc_socket_send

mongoc_socket_send()
====================

Synopsis
--------

.. code-block:: c

  ssize_t
  mongoc_socket_send (mongoc_socket_t *sock,
                      const void *buf,
                      size_t buflen,
                      int64_t expire_at);

Parameters
----------

* ``sock``: A :symbol:`mongoc_socket_t`.
* ``buf``: A buffer to send.
* ``buflen``: A size_t with the number of bytes in buf.
* ``expire_at``: A int64_t with an absolute timeout for the operation or 0. The timeout is in monotonic time using microseconds. You can retrieve the current monotonic time with :symbol:`bson:bson_get_monotonic_time()`.

Description
-----------

Sends buflen bytes in buf to the destination. If a timeout expired, the number of bytes sent will be returned or -1 if no bytes were sent.

Returns
-------

-1 on failure and errno is set, or the number of bytes sent.