Re: Using NSSocketPort
Re: Using NSSocketPort
- Subject: Re: Using NSSocketPort
- From: Mike Laster <email@hidden>
- Date: Mon, 22 Apr 2002 20:56:16 -0400
On 4/21/02 11:32 PM, "email@hidden" <email@hidden> wrote:
>
On Sunday, April 21, 2002, at 06:30 PM, Mike Laster wrote:
>
>
> On 4/21/02 8:13 PM, "Michael P. Rogers" <email@hidden> wrote:
>
>
>
>> At 20:26 -0400 20/4/02, Mike Laster wrote:
>
>>> Does anyone have any sample code on how to use NSSocketPort?
>
>>
>
>> Here's an example from cocoadevcentral, written by H. Lally Singh:
>
>>
>
>> http://www.cocoadevcentral.com/tutorials/showpage.php?show=00000038.php
>
>
>
> This isn't really what I'm wanting to do. I'm trying to make a server
>
> for
>
> an existing network protocol, so therefore I can't use NSConnection. I
>
> just
>
> trying to use NSSocketPort in order to accept connections within the run
>
> loop.
>
>
use SmallSockets. NSSocketPort is a socket wrapper on NSPort, not a
>
general BSD socket wrapper.
I thought NSSocketPort was just an ObjC wrapper around CFSocket, and
CFSocket appears to be the behavior that I want:
/* A CFSocket contains a native socket within a structure that can
be used to read from the socket in the background and make the data
thus read available using a runloop source. The callback used for
this may be of three types, as specified by the callBackTypes
argument when creating the CFSocket.
I haven't delved into the smallsockets source code, but I expect it has the
same problem that my current network classes do...accepting new connections
and receiving data do not integrate into the run loop.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.