Existing users, log in.  New users, create a free account.  Lost password?

Mac OS X  |  Web & Software Development  |  Other Developer Tools  |  AsyncSocket

AsyncSocket

AsyncSocket - 3.12

Cocoa socket class

All Time: (4.5)
Version 3.12: (4.0)
Selected Version: 3.12
Release Date: 2004-07-11
License: Freeware
Downloads (version 3.12): 454
Downloads (all versions): 4,702

Information Related to Version:

Broken Link? Newer Version? Tell us!

Product Description:

AsyncSocket is a class that wraps CFSocket and CFStream. I've compared it against DizSocket, NetSocket, and SmallSockets, and I dare say that AsyncSocket is the best socket class out there short of OmniNetworking.

Key Features:
  • Queued non-blocking reads and writes, with timeouts. You tell it what to read or write and get out of the way. It'll call you when it is done.
  • Automatic socket acceptance. If you tell it to accept connections, it will call you with new instances of itself for each connection. You can, of course, disconnect them immediately.
  • Delegate support. Errors, connections, accepts, read completions, write completions, and disconnections all result in a call to your delegate method.
  • Run-loop based, not thread based. Although you can use it on main or worker threads, you don't have to. It calls the delegate methods asynchronously using NSRunLoop. The delegate methods include a socket parameter, allowing you to distinguish between many instances.
  • Self-contained in one class. You don't need to muck around with streams or sockets. The class handles all of that.
  • Support for TCP streams over IPv4.

What's new in this version:

  • Fixed bug in -readDataOfLength:withTag:.
  • Now sends/reads queued packets immediately after connecting.

Operating System Requirements:

This product is designed to run on the following operating systems:

  • Mac OS X 10.3
  • Mac OS X 10.2

Additional Requirements:

  • Mac OS X 10.2 or higher
  • Apple Developer Tools

Screenshots:

Download Links:

Download Links:

Your Installed Versions:


 

Feedback Summary:

Version 3.12:
Overall Rating: (4.0) Features: (4.0) Support: (5.0)
Ease of Use: (4.5) Quality / Stability: (4.0) Price: (5.0)
Add Your Feedback

Key to Types of Feedback:

ReviewsReviews   TroubleshootingTroubleshooting   Usage TipsUsage Tips   Developer NotesDeveloper Notes   CommentaryCommentary   Featured ReviewsFeatured Reviews

AsyncSocket Developer NotePerformance issues addressed? - Version: 4.0, 5/16/2005 09:41AM PST

Dustin_Voss_785
I am the author of AsyncSocket. I've addressed some of tyraynor's performance issues in version 4.0. It should be a more capable server now.
Post a commentAlert Admin

AsyncSocket ReviewExcellent design, but there are performance issues - Version: 3.12, 11/19/2004 11:09AM PST

(4 of 4 users found this comment useful)

tyrayner
I must amend my previous review now that I have made extensive use of AsyncSocket. I still recommend this class to anyone who is implementing sockets on a small scale, but if you're going to be dealing with large amounts of data and many simultaneous connections this class will not be adequate. There are major performance problems.

Over the past few months I have been writing an OS X HTTP proxy server. Initially I planned on writing the socket functionality with SmallSockets, my old favorite, but the synchronous nature of SmallSockets was going to be a problem. So I wrote my connection classes using AsyncSocket, and I was thrilled with the simplicity and the incredibly clean and intuitive design of this class. When I started stress-testing my proxy server, however, it would sustain 40-50% CPU utilization when downloading large files over my cable connection. I ended up re-writing the program using SmallSockets and implementing threads manually to make it asynchronous. Now the CPU utilization never spikes above 2-3%. I wrestled with AsyncSocket for a long time trying to see if I could get the CPU utilization down, but I think it's a factor of the single-threaded, notifications-based architecture of this class.

In conclusion, this does have the nicest interface of all the OS X socket classes. OmniNetworking is big and confusing. I haven't tried NetSocket so I don't know about that one. SmallSockets is the leanest and meanest, but you have to get a bit more low-level with it. If you're implementing sockets on a small scale, this is probably still your best and easiest choice.
Post a commentAlert Admin

Most Recent Replies: View All 1 Replies

AsyncSocket ReviewThe class Apple forgot! - Version: 3.12, 8/2/2004 09:23AM PST

(1 of 1 users found this comment useful)

fejta
When making an internet program you want a socket class that is easy to use and efficient. AsyncSocket hits both of these goals right on the head. All you need to do is define a couple functions in your class, instantiate AsyncSocket, set yourself up as the receiver and call a couple functions. Preso! Instant internet connectivity!

SolarSeek, a p2p client, uses this class. Being a p2p client, it has to manage a large number of simultaneous connections. AsyncSocket is the ideal choice because it can handle many connections at once without any extra programming or threads. Yet it still neither blocks nor pegs the resource meter at 100%.

Also, the author will quickly resolve any bugs you may find in his class after providing him with sufficient evidence his code is at fault.

Excellent work, this class comes highly recommended.
Post a commentAlert Admin