Is it possible for an objective-c mac app to send UDP data to its own IP address?
If so, can someone show me an example? code?
Thanks!
Have a look at http://code.google.com/p/polkit containing Objective-C UDPSocket sample code and MiniUDPSocket to send and receive network data over UDP:
polkit-read-only/Apple-Networking/UDPSocket.h
polkit-read-only/Apple-Networking/UDPSocket.m
polkit-read-only/Networking/MiniUDPSocket.h
polkit-read-only/Networking/MiniUDPSocket.m
Related
I need to send screen video in real-time from Mac to a multicast group,like"239.1.1.110:46110".
I know the AVCaptureMovieFileOutput has a method"startRecordingToOutputFileURL: recordingDelegate:".
I just want to know the parameter of URL can be a multicast group address? Or if is no,what can I do to send the stream video to the multicast group?
Someone said using ffmpeg,but I nothing about that.Could anybody give some sample demo?
Any help is appreciated.Thanks a lat in advance.
Have you looked at this project provided by Apple - AVFoundationQueuePlayer
I'd like to implement a "Picture Transfer Protocol over IP" (PTP/IP) connection with Objective C between my camera (Nikon D5300) and my Mac to transfer photos and other data wirelessly.
The camera creates a WiFi hotspot, and the Mac connects to it.
I know that the camera uses port 15740.
What is the best point to start with? NSInputStream?
I know that ShutterSnitch has this (iOS app). I emailed its author, who while wasn't willing to license me his work, was very kind to point me to the following resources:
http://www.shuttersnitch.com/forums/viewtopic.php?f=4&t=1580
I use CocoaAsyncSocket for communication. For communication, look at the PTP (over USB) spec and http://www.cipa.jp/ptp-ip/index_e.html. The payload packets are pretty much like in the USB spec but have some different header bytes.
I want to use MAC address instead of IP address in RAW socket.
Is it possible?
Note: CLI/C++ and the system is connected to two devices
No, it is not possible.
So sorry
I have a string that I want to send to another computer that uses my software. I would like to send the string directly to the software in the other computer. Is there any way to do it?
other alternatives are to use tcp or udp broadcasts
If you need to send the string to multiple computers at once you can use a udp broadcast to 255.255.255.255 ; however with udp there is no confirmation of receipt.
Lots of examples are available if you search for them, here is one:
http://msdn.microsoft.com/en-us/library/tst0kwb1(v=VS.71).aspx
A standard way of achieving such task is to use Sockets. There are plenty of examples over the internet depending on the language and environment you are using.
The following link might be useful to you:
http://msdn.microsoft.com/en-us/library/system.net.sockets.socket.aspx
I want to search for my media player on the network. Am I right in thinking it is done using SSDP m-search?
Also, when I switch the device on, will it broadcast its availability? How do I go about listening for that broadcast, and how do I send the m-search query?
I want to search for my media player on the network. Am I right in thinking it is done using SSDP m-search?
Yes.
Also, when I switch the device on, will it broadcast its availability?
Yes
How do I go about listening for that broadcast, and how do I send the m-search query?
You need to bind to the UDP multicast group 239.255.255.250:1900. The M-SEARCH query is sent to the same address.
Both.
In general, a UPnP device will advertise itself from time to time via a NOTIFY message.
At the same time, other devices can broadcast an M-SEARCH message to ask local devices on the network if they meet it's query, and if so, will/should cause those devices to re-advertise themselves again.
So yes... you could do a search for your media player via an M-SEARCH message, looking for a urn:schemas-upnp-org:device:MediaRenderer:1
As for how you send an M-SEARCH query... UDP multicast is the protocol SSDP uses, so sending a broadcast message via that depends on the language & libraries you are using.