iphone sdk: playing video from localhost? - iphone

I have a server socket (on port 3490) in my app which has a video data - It runs on a different thread. Now I have a mpmovieplayercontroller and would like to read the data from the socket and play it. I'm not sure what url should I pass to it. I've tried file://localhost:3490
http://localhost:3490
but this doesn't work. Please help
Thanks
Alex

You say server socket but you don't mention what kind of protocol the server implements. Is it HTTP? If so then you will need to use a http URL.

Related

Socket Connection on iPhone

I want to establish socket connection between iphone and a web service that has its own IP address, service name (e.g "_abc._tcp"), and it also contains information about files stored. How can I do this? Can you please help with some sample code or links.
My goal is to develop an application that will get a video file from that server to my iphone and play it.
At first I try to get information of the files but I don't know how to connect to that server and make the video played on my iPhone.
Many thanks in advance
There is a great library for socket programming in objc here CocoaAsyncSocket
Which will help you out a lot. The examples also show how to use NSNetServices to broadcast a Bonjour service.

Listen to incoming HTTP messages on iPhone

I have to do a simple iPhone project as part of an university exam which consists in creating a simple instant messenger based on a client/server system using the Java Servlet technology (required).
What I would like to know is if there is a framework or some simple classes that make me able to listen for incoming http message from a server without make a request so that an iPhone can send directly to another iPhone an instant message.
Thanks in advance and have a nice day!
L.
From what I understand from your question, you need a listener. There are several 3rd party implementations that provide what you need. Basically you just need to open a socket for listening on a HTTP server running on your iPhone.
Try these, it should provide you with what yo need
CocoaHTTPServer.
MongooseDaemon
If youre looking for a way to receive message from WEB server - you may use Apple Notification service (here`s a good tutorial)
Another way is to use long-poll connection, but is not an easy thing to implement in IOS.
Maybe you can check for incoming message by requesting web server from iPhone (ex. every 10 seconds)?

Set Up Http Server on Iphone

Can we set up HTTP server on iPhone for audio streaming . I need to set up my iphone as a http server where i have to upload the audio buffer and do the live http streaming
Since Apple's HTTP Live Streaming is based on static files, you can use a HTTP Server. There are at least a couple: cocoahttpserver, CocoaHTTPServer, and you can read how to do yours.
Or you can program the whole thing using socket programming and bonjour, so clients can find each other. Apple has an example project to send pictures between iphones whose name I don't remember. :P You can read more about it in Network Programming: Chapter 7 - iPhone SDK Application Development
Socket programming is close to C, and needs a bit more work than UIKit.
i have successfully built/config'd/run lighttpd on iPad and had it serve an HTTP Live Stream as well. it was pretty straight forward... just get the source, massage the config, make, then fiddle with the install and it just worked.

Ping webserver when iphone app loads

I was wondering how I could ping a web server of mine when my application first starts. I am assuming I would do s via the appdelegate in the application? Is there any specific example I could use?
What is your problem actually? You want to know whether Internet and/or your server is available or you want to know when to ping it? If you want to know the network or host status then you can use Reachability sample app by Apple. This Rechability class is widely used.

upload file into iphone app via ftp

I wish upload a file into my iphone app via ftp ( wifi connection on iphone) like some program as airsharing or iFiles..
which are the first steps to do this??
thanks in advance
The iPhone SDK does not have a built-in FTP server, so you will have to implement a simple FTP server yourself.
First, get an overview of the FTP protocol on Wikipedia. Read the actual RFCs, which document the protocol, in the 'Further Reading' section. Some of the external links are helpful for understanding the flow of an FTP transfer.
Next, brush up on iPhone socket communication. The Apple documentation for CFSocket is a good starting point. Consider using the AsyncSocket library to ease implementation.
You would begin by creating an FTP server in your application.