RRTCPConnection

Name

RRTCPConnection -- 

Synopsis



RRConnection* rr_tcp_connection_new         (RRProfileRegistry *profreg,
                                             const gchar *hostname,
                                             gint port,
                                             GError **error);
gboolean    rr_tcp_connection_connect       (RRTCPConnection *connection,
                                             const gchar *hostname,
                                             gint port,
                                             GError **error);
RRTCPConnection* rr_tcp_connection_new_unconnected
                                            (RRProfileRegistry *profreg);
gboolean    rr_tcp_connection_connect_fd    (RRTCPConnection *tcpc,
                                             gint fd,
                                             RRRole role,
                                             GError **error);
gint        rr_tcp_connection_get_fd        (RRTCPConnection *tcpc);

Object Hierarchy


  GObject
   +----RRConnection
         +----RRTCPConnection

Description

Details

rr_tcp_connection_new ()

RRConnection* rr_tcp_connection_new         (RRProfileRegistry *profreg,
                                             const gchar *hostname,
                                             gint port,
                                             GError **error);

Creates a new RRTCPConnection instance and tries to opens a connection to a beep peer, using the TCP/IP protocol.

profreg : a RRProfileRegistry
hostname : a hostname
port : a port
error : location to return an error of type G_IO_ERROR, RR_ERROR or RR_BEEP_ERROR.
Returns : A new (connected) RRTCPConnection instance on success, and NULL on failure.


rr_tcp_connection_connect ()

gboolean    rr_tcp_connection_connect       (RRTCPConnection *connection,
                                             const gchar *hostname,
                                             gint port,
                                             GError **error);

Opens a connection to a beep peer, using the TCP/IP protocol.

connection : A RRTCPConnection
hostname : a hostname
port : a port
error : location to return an error of type G_IO_ERROR, RR_ERROR or RR_BEEP_ERROR.
Returns : TRUE on success, FALSE on failure.


rr_tcp_connection_new_unconnected ()

RRTCPConnection* rr_tcp_connection_new_unconnected
                                            (RRProfileRegistry *profreg);

This function creates a new tcp connection object. Note: the profreg will be g_object unref:ed.

profreg : A RRProfileRegistry of profiles this connection supports.
Returns : the new RRTCPConnection.


rr_tcp_connection_connect_fd ()

gboolean    rr_tcp_connection_connect_fd    (RRTCPConnection *tcpc,
                                             gint fd,
                                             RRRole role,
                                             GError **error);

Opens a BEEP connection to a beep peer, using an already open socket.

tcpc : A RRTCPConnection
fd : an open file descriptor
role : a RRRole
error : error: location to return an error of type G_IO_ERROR, RR_ERROR or RR_BEEP_ERROR.
Returns : TRUE on success, FALSE on failure.


rr_tcp_connection_get_fd ()

gint        rr_tcp_connection_get_fd        (RRTCPConnection *tcpc);

Returns the file-descriptor associated with the socket.

tcpc : A RRTCPConnection
Returns : the file-descriptor associated with the socket.