## socketsrc

socketsrc

## Properties

GSocket * | socket | Read / Write
GstCaps * | caps | Read / Write
gboolean | send-messages | Read / Write

## Signals

void | connection-closed-by-peer | Run First

## Types and Values

struct | GstSocketSrc

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GstObject
                ╰── GstElement
                    ╰── GstBaseSrc
                        ╰── GstPushSrc
                            ╰── GstSocketSrc

## Description

Receive data from a socket.

As compared to other elements:

socketsrc can be considered a source counterpart to the multisocketsink sink.

socketsrc can also be considered a generalization of tcpclientsrc and tcpserversrc: it contains all the logic required to communicate over the socket but none of the logic for creating the sockets/establishing the connection in the first place, allowing the user to accomplish this externally in whatever manner they wish making it applicable to other types of sockets besides TCP.

As compared to fdsrc socketsrc is socket specific and deals with GSocket objects rather than sockets via integer file-descriptors.

`see_also` : multisocketsink

## Synopsis

### Element Information

plugin | tcp
author | Thomas Vander Stichele <thomas at apestaart dot org>, William Manley <will@williammanley.net>
class | Source/Network

### Element Pads

name | src
direction | source
presence | always
details | ANY

## Functions

## Types and Values

### struct GstSocketSrc

    struct GstSocketSrc;

## Property Details

### The `“socket”` property

      “socket”                   GSocket *

The socket to receive packets from.

Flags: Read / Write

### The `“caps”` property

      “caps”                     GstCaps *

The caps of the source pad.

Flags: Read / Write

### The `“send-messages”` property

      “send-messages”            gboolean

Control if the source will handle GstNetworkMessage events. The event is a CUSTOM event named 'GstNetworkMessage' and contains:

"buffer", GST_TYPE_BUFFER : the buffer with data to send

The buffer in the event will be sent on the socket. This allows for simple bidirectional communication.

Flags: Read / Write

Default value: FALSE

Since: 1.8.0

## Signal Details

### The `“connection-closed-by-peer”` signal

    void
    user_function (GstSocketSrc *gstsocketsrc,
                   gpointer      user_data)

Flags: Run First