public static GLib.SocketConnection FactoryCreateConnection(GLib.Socket socket) { IntPtr raw_ret = g_socket_connection_factory_create_connection(socket == null ? IntPtr.Zero : socket.Handle); GLib.SocketConnection ret = GLib.Object.GetObject(raw_ret) as GLib.SocketConnection; return(ret); }
public static bool NetUtilsSetSocketTos(GLib.Socket socket, int qos_dscp) { bool raw_ret = gst_net_utils_set_socket_tos(socket == null ? IntPtr.Zero : socket.Handle, qos_dscp); bool ret = raw_ret; return(ret); }
public static Gst.Rtsp.RTSPResult RtspConnectionAccept(GLib.Socket socket, out Gst.Rtsp.RTSPConnection conn, GLib.Cancellable cancellable) { IntPtr native_conn; int raw_ret = gst_rtsp_connection_accept(socket == null ? IntPtr.Zero : socket.Handle, out native_conn, cancellable == null ? IntPtr.Zero : cancellable.Handle); Gst.Rtsp.RTSPResult ret = (Gst.Rtsp.RTSPResult)raw_ret; conn = native_conn == IntPtr.Zero ? null : (Gst.Rtsp.RTSPConnection)GLib.Opaque.GetOpaque(native_conn, typeof(Gst.Rtsp.RTSPConnection), true); return(ret); }
public unsafe bool AddSocket(GLib.Socket socket, GLib.Object source_object) { IntPtr error = IntPtr.Zero; bool raw_ret = g_socket_listener_add_socket(Handle, socket == null ? IntPtr.Zero : socket.Handle, source_object == null ? IntPtr.Zero : source_object.Handle, out error); bool ret = raw_ret; if (error != IntPtr.Zero) { throw new GLib.GException(error); } return(ret); }
public unsafe GLib.Socket AcceptSocketFinish(GLib.IAsyncResult result, GLib.Object source_object) { IntPtr error = IntPtr.Zero; IntPtr raw_ret = g_socket_listener_accept_socket_finish(Handle, result == null ? IntPtr.Zero : ((result is GLib.Object) ? (result as GLib.Object).Handle : (result as GLib.AsyncResultAdapter).Handle), source_object == null ? IntPtr.Zero : source_object.Handle, out error); GLib.Socket ret = raw_ret == IntPtr.Zero ? null : (GLib.Socket)GLib.Opaque.GetOpaque(raw_ret, typeof(GLib.Socket), false); if (error != IntPtr.Zero) { throw new GLib.GException(error); } return(ret); }
public unsafe GLib.Socket AcceptSocket(GLib.Object source_object, GLib.Cancellable cancellable) { IntPtr error = IntPtr.Zero; IntPtr raw_ret = g_socket_listener_accept_socket(Handle, source_object == null ? IntPtr.Zero : source_object.Handle, cancellable == null ? IntPtr.Zero : cancellable.Handle, out error); GLib.Socket ret = raw_ret == IntPtr.Zero ? null : (GLib.Socket)GLib.Opaque.GetOpaque(raw_ret, typeof(GLib.Socket), false); if (error != IntPtr.Zero) { throw new GLib.GException(error); } return(ret); }
public static Gst.Rtsp.RTSPResult RtspConnectionCreateFromSocket(GLib.Socket socket, string ip, ushort port, string initial_buffer, out Gst.Rtsp.RTSPConnection conn) { IntPtr native_ip = GLib.Marshaller.StringToPtrGStrdup(ip); IntPtr native_initial_buffer = GLib.Marshaller.StringToPtrGStrdup(initial_buffer); IntPtr native_conn; int raw_ret = gst_rtsp_connection_create_from_socket(socket == null ? IntPtr.Zero : socket.Handle, native_ip, port, native_initial_buffer, out native_conn); Gst.Rtsp.RTSPResult ret = (Gst.Rtsp.RTSPResult)raw_ret; GLib.Marshaller.Free(native_ip); GLib.Marshaller.Free(native_initial_buffer); conn = native_conn == IntPtr.Zero ? null : (Gst.Rtsp.RTSPConnection)GLib.Opaque.GetOpaque(native_conn, typeof(Gst.Rtsp.RTSPConnection), true); return(ret); }
private void InternalSocketEvent(out GLib.SocketListenerEvent evnt, GLib.Socket socket) { SocketEventNativeDelegate unmanaged = class_abi.BaseOverride <SocketEventNativeDelegate>(this.LookupGType(), "event"); if (unmanaged == null) { throw new InvalidOperationException("No base method to invoke"); } int native_evnt; unmanaged(this.Handle, out native_evnt, socket == null ? IntPtr.Zero : socket.Handle); evnt = (GLib.SocketListenerEvent)native_evnt; }
public static unsafe Gst.Net.NetTimePacket Receive(GLib.Socket socket, out GLib.SocketAddress src_address) { IntPtr native_src_address; IntPtr error = IntPtr.Zero; IntPtr raw_ret = gst_net_time_packet_receive(socket == null ? IntPtr.Zero : socket.Handle, out native_src_address, out error); Gst.Net.NetTimePacket ret = Gst.Net.NetTimePacket.New(raw_ret); src_address = GLib.Object.GetObject(native_src_address, true) as GLib.SocketAddress; if (error != IntPtr.Zero) { throw new GLib.GException(error); } return(ret); }
public unsafe bool Send(GLib.Socket socket, GLib.SocketAddress dest_address) { IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal(System.Runtime.InteropServices.Marshal.SizeOf(this)); System.Runtime.InteropServices.Marshal.StructureToPtr(this, this_as_native, false); IntPtr error = IntPtr.Zero; bool raw_ret = gst_net_time_packet_send(this_as_native, socket == null ? IntPtr.Zero : socket.Handle, dest_address == null ? IntPtr.Zero : dest_address.Handle, out error); bool ret = raw_ret; ReadNative(this_as_native, ref this); System.Runtime.InteropServices.Marshal.FreeHGlobal(this_as_native); if (error != IntPtr.Zero) { throw new GLib.GException(error); } return(ret); }
private void InternalEvent(out GLib.SocketListenerEvent evnt, GLib.Socket socket) { EventNativeDelegate unmanaged = null; unsafe { IntPtr *raw_ptr = (IntPtr *)(((long)this.LookupGType().GetThresholdType().GetClassPtr()) + (long)class_abi.GetFieldOffset("event")); unmanaged = (EventNativeDelegate)Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(EventNativeDelegate)); } if (unmanaged == null) { throw new InvalidOperationException("No base method to invoke"); } int native_evnt; unmanaged(this.Handle, out native_evnt, socket == null ? IntPtr.Zero : socket.Handle); evnt = (GLib.SocketListenerEvent)native_evnt; }
public TcpWrapperConnection(GLib.IOStream base_io_stream, GLib.Socket socket) : base(IntPtr.Zero) { if (GetType() != typeof(TcpWrapperConnection)) { var vals = new List <GLib.Value> (); var names = new List <string> (); if (base_io_stream != null) { names.Add("base_io_stream"); vals.Add(new GLib.Value(base_io_stream)); } if (socket != null) { names.Add("socket"); vals.Add(new GLib.Value(socket)); } CreateNativeObject(names.ToArray(), vals.ToArray()); return; } Raw = g_tcp_wrapper_connection_new(base_io_stream == null ? IntPtr.Zero : base_io_stream.Handle, socket == null ? IntPtr.Zero : socket.Handle); }
public static Gst.Rtsp.RTSPResult RtspConnectionAccept(GLib.Socket socket, out Gst.Rtsp.RTSPConnection conn) { return(RtspConnectionAccept(socket, out conn, null)); }
bool InvokeNative(GLib.Socket socket, GLib.IOCondition condition) { bool __result = native_cb(socket == null ? IntPtr.Zero : socket.Handle, (int)condition, __data); return(__result); }
protected virtual void OnSocketEvent(out GLib.SocketListenerEvent evnt, GLib.Socket socket) { InternalSocketEvent(out evnt, socket); }