View Full Version : Cocoa And UDP
lostingamma
Jun 12, 2005, 01:01 PM
I have been trying to find information on Cocoa and UDP, but I have been unsucessful. I wish my program to send a UDP Packet the IP Address and Port I specifiy. I would also like it to be able to recieve UDP Packets that were sent from the server. This program will communicate with a server, send it information, and recieve information. The information it recieves from the server should then be placed into a variable for later use. I have done it in Visual Basic, but I wish to now do it in Cocoa. :)
ITASOR
Jun 12, 2005, 03:23 PM
Ew, I know Visual Basic....it's gross. Good job trying out Cocoa, I heard it's really good. I still have to install xCode and check it out.
robbieduncan
Jun 13, 2005, 04:14 AM
There is no Cocoa specific way of doing this (at least built in, there are third party libraries). Objective C is a superset of C. Look for resources on Unix Network programming (using C).
lostingamma
Jun 13, 2005, 06:01 AM
lol, i didn't even think about that, your right, i found tons of c tutorials, i didn't even think abou the fact that u can use c in cocoa
jcgerm
Jun 13, 2005, 11:25 AM
lol, i didn't even think about that, your right, i found tons of c tutorials, i didn't even think abou the fact that u can use c in cocoa
You can actually use a combination of BSD sockets and CFSocket. You can setup the connection with BSD sockets and then use CFSocket to read/write from the connection you setup. It should be easier since CFSocket is a higher level API and you can use streams to get data from the socket(s) you're dealing with. Which, in my opinion, is easier than dealing with finite size buffers with BSD sockets.
vBulletin® v3.8.6, Copyright ©2000-2013, Jelsoft Enterprises Ltd.