Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 12-18-2008, 12:42 PM   #1 (permalink)
Registered Member
 
Join Date: Dec 2008
Location: Oceanside, CA
Posts: 570
aryaxt is on a distinguished road
Question CFSocket ==> Example ?!?!?!?!

I am trying to make a client side which communicates with the server using socket. I decided to use CFSocket.
My application recognizes CFSocketRef but not CFSocket;
If the class name is CFSocket then what the heck is CFSocketRef?
Anyone has an example or sample that shows how to use CFSOcket, or any other socket class?

Thank You
aryaxt is offline   Reply With Quote
Old 12-18-2008, 02:46 PM   #2 (permalink)
Registered Member
 
RickMaddy's Avatar
 
Join Date: Oct 2008
Location: Denver, CO
Posts: 2,121
RickMaddy will become famous soon enough
Default

There is no class named CFSocket. All of the various CFSocketWhatever functions work with a variable of type CFSocketRef which is declared as a pointer to a C structure. This is all C, not Objective-C. You are now working with pointers, not classes.

You don't use retain and release. You now use CFRetain(mySocketRefVar) and CFRelease(myCFSocketRefVar).
RickMaddy is offline   Reply With Quote
Old 12-18-2008, 08:07 PM   #3 (permalink)
Registered Member
 
Join Date: Dec 2008
Location: Oceanside, CA
Posts: 570
aryaxt is on a distinguished road
Default

thanks again great help on both my questions.
I better learn c programming, I don't even know what a pointer is.
I've done only object oriented programming.
aryaxt is offline   Reply With Quote
Old 12-18-2008, 08:45 PM   #4 (permalink)
Registered Member
 
RickMaddy's Avatar
 
Join Date: Oct 2008
Location: Denver, CO
Posts: 2,121
RickMaddy will become famous soon enough
Default

What languages? Most OO languages use pointers.
RickMaddy is offline   Reply With Quote
Old 12-18-2008, 10:58 PM   #5 (permalink)
Registered Member
 
Join Date: Dec 2008
Location: Oceanside, CA
Posts: 570
aryaxt is on a distinguished road
Default

Quote:
Originally Posted by RickMaddy View Post
What languages? Most OO languages use pointers.
C#, vb.net, php, action script, etc
And I never had to use a pointer even if it was available in the language
aryaxt is offline   Reply With Quote
Reply

Bookmarks

Tags
cfsocket, cfsocketref, socket

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 353
10 members and 343 guests
dansparrow, iOS.Lover, lorrettaui53, MikaelBartlett, Nobbsy, oztemel, pbart, PlutoPrime, thephotographer, Trickphotostudios
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,663
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, LezB44
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:57 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0