public static void CreateBoundPair(out CFReadStream readStream, out CFWriteStream writeStream, int bufferSize) { IntPtr read, write; CFStreamCreateBoundPair(IntPtr.Zero, out read, out write, bufferSize); readStream = new CFReadStream(read); writeStream = new CFWriteStream(write); }
public static void CreatePairWithSocket(CFSocket socket, out CFReadStream readStream, out CFWriteStream writeStream) { IntPtr read, write; CFStreamCreatePairWithSocket(IntPtr.Zero, socket.GetNative(), out read, out write); readStream = new CFReadStream(read); writeStream = new CFWriteStream(write); }
public static void CreatePairWithSocketToHost(string host, int port, out CFReadStream readStream, out CFWriteStream writeStream) { using (var str = new CFString(host)) { IntPtr read, write; CFStreamCreatePairWithSocketToHost( IntPtr.Zero, str.Handle, port, out read, out write); readStream = new CFReadStream(read); writeStream = new CFWriteStream(write); } }
public static void CreatePairWithSocketToHost(IPEndPoint endpoint, out CFReadStream readStream, out CFWriteStream writeStream) { using (var host = CFHost.Create(endpoint)) { IntPtr read, write; CFStreamCreatePairWithSocketToCFHost( IntPtr.Zero, host.Handle, endpoint.Port, out read, out write); readStream = new CFReadStream(read); writeStream = new CFWriteStream(write); } }
public static void CreatePairWithPeerSocketSignature(AddressFamily family, SocketType type, ProtocolType proto, IPEndPoint endpoint, out CFReadStream readStream, out CFWriteStream writeStream) { using (var address = new CFSocketAddress(endpoint)) { var sig = new CFSocketSignature(family, type, proto, address); IntPtr read, write; CFStreamCreatePairWithPeerSocketSignature(IntPtr.Zero, ref sig, out read, out write); readStream = new CFReadStream(read); writeStream = new CFWriteStream(write); } }
public static void CreatePairWithSocketToHost(IPEndPoint endpoint, out CFReadStream readStream, out CFWriteStream writeStream) { using (var host = CFHost.CreateWithAddress (endpoint.Address)) { IntPtr read, write; CFStreamCreatePairWithSocketToCFHost ( IntPtr.Zero, host.Handle, endpoint.Port, out read, out write); readStream = new CFReadStream (read); writeStream = new CFWriteStream (write); } }
public static void CreatePairWithSocket(CFSocket socket, out CFReadStream readStream, out CFWriteStream writeStream) { IntPtr read, write; CFStreamCreatePairWithSocket (IntPtr.Zero, socket.GetNative (), out read, out write); readStream = new CFReadStream (read); writeStream = new CFWriteStream (write); }
public static void CreatePairWithPeerSocketSignature(AddressFamily family, SocketType type, ProtocolType proto, IPEndPoint endpoint, out CFReadStream readStream, out CFWriteStream writeStream) { using (var address = new CFSocketAddress (endpoint)) { var sig = new CFSocketSignature (family, type, proto, address); IntPtr read, write; CFStreamCreatePairWithPeerSocketSignature (IntPtr.Zero, ref sig, out read, out write); readStream = new CFReadStream (read); writeStream = new CFWriteStream (write); } }
public static CFHTTPStream CreateForStreamedHTTPRequest(CFHTTPMessage request, CFReadStream body) { var handle = CFReadStreamCreateForStreamedHTTPRequest (IntPtr.Zero, request.Handle, body.Handle); if (handle == IntPtr.Zero) return null; return new CFHTTPStream (handle); }
public static void CreateBoundPair(out CFReadStream readStream, out CFWriteStream writeStream, int bufferSize) { IntPtr read, write; CFStreamCreateBoundPair (IntPtr.Zero, out read, out write, bufferSize); readStream = new CFReadStream (read); writeStream = new CFWriteStream (write); }
public static CFHTTPStream CreateForStreamedHTTPRequest(CFHTTPMessage request, CFReadStream body) { var handle = CFReadStreamCreateForStreamedHTTPRequest(IntPtr.Zero, request.Handle, body.Handle); if (handle == IntPtr.Zero) { return(null); } return(new CFHTTPStream(handle)); }
public static void CreatePairWithSocketToHost (string host, int port, out CFReadStream readStream, out CFWriteStream writeStream) { using (var str = new CFString (host)) { IntPtr read, write; CFStreamCreatePairWithSocketToHost ( IntPtr.Zero, str.Handle, port, out read, out write); readStream = new CFReadStream (read); writeStream = new CFWriteStream (write); } }