简体   繁体   中英

Using an writestream directly to an IP and port in ios

I'm trying to create an app that is able to send a .pdf-file directly to a printer from an iPhone. I'd like to create a raw socket connection. I should be able to open a stream to a specific IP-adress and a port. Then I'd like to throw that .PDF-file into the stream so the printer (or my server on the computer) receives it.

I've made a stream already using ftp. Ofcourse, printers don't handle ftp-protocols. That is why I want to send the data in a raw stream to the device's port.

Any idea how I can accomplish this?

CocoaAsyncSocket is really easy to use and has good documentation. It is an objective-c wrapper around lower level socket primitives. It sounds like all you need is to write data out to a socket. If so then it is the easiest way to go.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM