SwfdecSocket

SwfdecSocket — object used for network connections

Types and Values

Object Hierarchy

    GObject
    ╰── SwfdecStream
        ╰── SwfdecSocket
            ╰── SwfdecGtkSocket

Includes

#include <swfdec/swfdec.h>

Description

SwfdecSockets are used to implement TCP streams. These are for example used to implement RTMP support or the XMLSocket script class. Backends are supposed to provide an implementation for this, as by default this class is unimplemented. However, swfdec-gtk or other convenience libraries provide a socket implementation by default.

The socket implementation used by a SwfdecPlayer can be set with the SwfdecPlayer:socket-type property.

Functions

Types and Values

struct SwfdecSocket

struct SwfdecSocket;

This is the base object used for providing input. It is abstract, create a subclass to provide your own socket implementation. All members are considered private.


struct SwfdecSocketClass

struct SwfdecSocketClass {
  void			(* connect)		(SwfdecSocket * socket,
						 SwfdecPlayer * player,
						 const char * hostname,
						 guint		port);

  void			(* send)		(SwfdecSocket * socket,
						 SwfdecBuffer * buffer);
};

This is the socket class. When you create a subclass, you need to implement the functions listed above.

Members

connect ()

Connect the given newly created socket to the given hostname and port. If you encounter an error, call swfdec_stream_error(), but still make sure the socket object does not break.

 

send ()

Called to send data down the given socket. This function will only be called when the socket is open. You get passed a reference to the buffer, so it is your responsibility to call swfdec_buffer_unref() on it when you are done with it.