• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Using AGSocket for UDP networking
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using AGSocket for UDP networking


  • Subject: Using AGSocket for UDP networking
  • From: Rustam Muginov <email@hidden>
  • Date: Tue, 26 Jul 2005 17:22:09 +0400

Hello all.
I am trying to use AGSocket in Cocoa project to send and receive UDP
packets.
Sending works ok, but for receiving I am using the folowing code:


    AGInetSocketAddress *addr = [AGInetSocketAddress addressWithHostname:
@"127.0.0.1" port: 1001];

    socket = [[AGSocket udpSocket] retain];
    [socket setDelegate: self];

    BOOL b;
    b = [socket listenOnAddress: addr];
// Here is the problem
    NSLog( @"listen on addr = %d, error %d, \"%s\"", b, [socket error],
strerror( [socket error] ) );

    while( true )
    {
        NSData *data = [socket readDataOfLength: 128];
        NSLog( @"data read %d str %@", [data length], [[[NSString alloc]
initWithData:data encoding: NSUTF8StringEncoding ] autorelease] );
    }


If I am running this code, I am getting the following error after the
calling to the "listenOnAddress:" method I am getting " error 13,
"Permission denied" error.
This error is the same then I am working with my ADSL dinamyc adress.

If I am manualy launching application binary via terminal with "sudo"
command, it works ok.

In the office, at the local network, where IP is 172.16.0.2, I am getting
other error " error 49, "Can't assign requested address"


Does this need using AGSocket requires admin privileges?
Thank you.


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Using AGSocket for UDP networking
      • From: Rustam Muginov <email@hidden>
    • Re: Using AGSocket for UDP networking
      • From: email@hidden
  • Prev by Date: Re: NSMutableCopy Issue - New to Cocoa and Objective-C
  • Next by Date: Using filter predicate on an NSArrayController (simple q)
  • Previous by thread: Re: NSTreeController drag and drop
  • Next by thread: Re: Using AGSocket for UDP networking
  • Index(es):
    • Date
    • Thread