Ejemplo n.º 1
0
        public static void CreateBoundPair(out NSInputStream readStream, out NSOutputStream writeStream, nint bufferSize)
        {
            IntPtr read, write;

            CFStream.CFStreamCreateBoundPair(IntPtr.Zero, out read, out write, bufferSize);
            AssignStreams(read, write, out readStream, out writeStream);
        }
Ejemplo n.º 2
0
 public static void CreatePairWithSocketToHost(IPEndPoint endpoint,
                                               out NSInputStream readStream,
                                               out NSOutputStream writeStream)
 {
     using (var host = CFHost.Create(endpoint)) {
         IntPtr read, write;
         CFStream.CFStreamCreatePairWithSocketToCFHost(IntPtr.Zero, host.Handle, endpoint.Port, out read, out write);
         AssignStreams(read, write, out readStream, out writeStream);
     }
 }
Ejemplo n.º 3
0
 public static void CreatePairWithPeerSocketSignature(AddressFamily family, SocketType type,
                                                      ProtocolType proto, IPEndPoint endpoint,
                                                      out NSInputStream readStream,
                                                      out NSOutputStream writeStream)
 {
     using (var address = new CFSocketAddress(endpoint)) {
         var    sig = new CFSocketSignature(family, type, proto, address);
         IntPtr read, write;
         CFStream.CFStreamCreatePairWithPeerSocketSignature(IntPtr.Zero, ref sig, out read, out write);
         AssignStreams(read, write, out readStream, out writeStream);
     }
 }
Ejemplo n.º 4
0
        public static void CreatePairWithSocket(CFSocket socket,
                                                out NSInputStream readStream,
                                                out NSOutputStream writeStream)
        {
            if (socket == null)
            {
                throw new ArgumentNullException("socket");
            }

            IntPtr read, write;

            CFStream.CFStreamCreatePairWithSocket(IntPtr.Zero, socket.GetNative(), out read, out write);
            AssignStreams(read, write, out readStream, out writeStream);
        }
Ejemplo n.º 5
0
 public static void CreatePairWithSocketToHost(IPEndPoint endpoint,
     out NSInputStream readStream,
     out NSOutputStream writeStream)
 {
     using (var host = CFHost.Create (endpoint)) {
         IntPtr read, write;
         CFStream.CFStreamCreatePairWithSocketToCFHost (IntPtr.Zero, host.Handle, endpoint.Port, out read, out write);
         AssignStreams (read, write, out readStream, out writeStream);
     }
 }
Ejemplo n.º 6
0
 static void AssignStreams(IntPtr read, IntPtr write,
                           out NSInputStream readStream, out NSOutputStream writeStream)
 {
     readStream  = Runtime.GetNSObject <NSInputStream> (read);
     writeStream = Runtime.GetNSObject <NSOutputStream> (write);
 }
Ejemplo n.º 7
0
        public static void CreatePairWithSocket(CFSocket socket,
            out NSInputStream readStream,
            out NSOutputStream writeStream)
        {
            if (socket == null)
                throw new ArgumentNullException ("socket");

            IntPtr read, write;
            CFStream.CFStreamCreatePairWithSocket (IntPtr.Zero, socket.GetNative (), out read, out write);
            AssignStreams (read, write, out readStream, out writeStream);
        }
Ejemplo n.º 8
0
 static void AssignStreams(IntPtr read, IntPtr write,
     out NSInputStream readStream, out NSOutputStream writeStream)
 {
     readStream = Runtime.GetNSObject<NSInputStream> (read);
     writeStream = Runtime.GetNSObject<NSOutputStream> (write);
 }
Ejemplo n.º 9
0
 public static void CreatePairWithPeerSocketSignature(AddressFamily family, SocketType type,
     ProtocolType proto, IPEndPoint endpoint,
     out NSInputStream readStream,
     out NSOutputStream writeStream)
 {
     using (var address = new CFSocketAddress (endpoint)) {
         var sig = new CFSocketSignature (family, type, proto, address);
         IntPtr read, write;
         CFStream.CFStreamCreatePairWithPeerSocketSignature (IntPtr.Zero, ref sig, out read, out write);
         AssignStreams (read, write, out readStream, out writeStream);
     }
 }
Ejemplo n.º 10
0
 public static void CreateBoundPair(out NSInputStream readStream, out NSOutputStream writeStream, nint bufferSize)
 {
     IntPtr read, write;
     CFStream.CFStreamCreateBoundPair (IntPtr.Zero, out read, out write, bufferSize);
     AssignStreams (read, write, out readStream, out writeStream);
 }
 public static NSObject PropertyListWithStream(NSInputStream stream, ref NSPropertyListFormat format, out NSError error)
 {
     return(PropertyListWithStream(stream, NSPropertyListReadOptions.Immutable, ref format, out error));
 }
Ejemplo n.º 12
0
        public static CFHTTPStream CreateForStreamedHTTPRequest(CFHTTPMessage request, NSInputStream body)
        {
            if (request == null)
                throw new ArgumentNullException ("request");
            if (body == null)
                throw new ArgumentNullException ("body");

            var handle = CFReadStreamCreateForStreamedHTTPRequest (IntPtr.Zero, request.Handle, body.Handle);
            return new CFHTTPStream (handle);
        }
Ejemplo n.º 13
0
 public static NSObject PropertyListWithStream(NSInputStream stream, ref NSPropertyListFormat format, out NSError error)
 {
     return PropertyListWithStream (stream, NSPropertyListReadOptions.Immutable, ref format, out error);
 }