void log_transport_dgram_socket_init_instance(LogTransportSocket *self, gint fd) { log_transport_init_instance(&self->super, fd); self->super.read = log_transport_dgram_socket_read_method; self->super.write = log_transport_dgram_socket_write_method; }
void log_transport_file_init_instance(LogTransportFile *self, gint fd) { log_transport_init_instance(&self->super, fd); self->super.read = log_transport_file_read_method; self->super.write = log_transport_file_write_method; self->super.free_fn = log_transport_free_method; }
LogTransport * log_transport_streams_new(gint fd) { LogTransport *self = g_new0(LogTransport, 1); log_transport_init_instance(self, fd); self->cond = G_IO_IN; self->read = log_transport_streams_read; self->free_fn = log_transport_free_method; return self; }
LogTransport * log_transport_device_new(gint fd, gint timeout) { LogTransportDevice *self = g_new0(LogTransportDevice, 1); log_transport_init_instance(&self->super, fd); self->timeout = timeout; self->super.read = log_transport_device_read_method; self->super.write = NULL; self->super.free_fn = log_transport_free_method; return &self->super; }
LogTransport * log_transport_tls_new(TLSSession *tls_session, gint fd) { LogTransportTLS *self = g_new0(LogTransportTLS, 1); log_transport_init_instance(&self->super, fd); self->super.cond = G_IO_IN | G_IO_OUT; self->super.read = log_transport_tls_read_method; self->super.write = log_transport_tls_write_method; self->super.free_fn = log_transport_tls_free_method; self->tls_session = tls_session; SSL_set_fd(self->tls_session->ssl, fd); return &self->super; }