Send image over socket in iPhone
<p>How can i send image over socket in iPhone. I tried with string the code i used is as follows, now i need to send image over socket. </p>

<pre><code>CFWriteStreamRef writeStream = NULL;

CFStringRef host = CFSTR("192.168.1.211");
UInt32 port = 8001;

CFStreamCreatePairWithSocketToHost(kCFAllocatorDefault, host, port, NULL, &amp;writeStream);

CFWriteStreamSetProperty(writeStream, kCFStreamPropertyShouldCloseNativeSocket, kCFBooleanTrue);

if(!CFWriteStreamOpen(writeStream)) {
    NSLog(@"Error Opening Socket");
}
else{


    UInt8 buf[] = "Abc";        


    int bytesWritten = CFWriteStreamWrite(writeStream, buf, strlen((char*)buf));

    NSLog(@"Written: %d", bytesWritten);

    if (bytesWritten &lt; 0) {
        CFStreamError error = CFWriteStreamGetError(writeStream);

    }

}
</code></pre>

<p>Regards,</p>
