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); } }