Distributed Objects & Leopard

  • My client server application communicate over sockets  using
    NSConnection.

    On the client side, there are multiple threads (not the main thread),
    communicating with the server.

    Each thread has a single NSConnection. The connection is terminated by
    issuing an invalidate method on the connection and the thread is
    existed.

    On Tiger there is no problem with said architecture.

    On Leopard few seconds after the thread being terminated, all other
    threads (which contains an active NSConnection to the server) receives
    the following exception (if there are no more threads connected to the
    same server, the exception does not occur - in this example there 3
    threads which receive the exception):

    *** NSDistantObject initWithCoder: 0x3 not given away for conn
    0x1514bde0
    *** -[NSConcretePortCoder decodeInvocation]: no local target
    *** NSDistantObject initWithCoder: 0x4 not given away for conn
    0x1514f9d0
    *** -[NSConcretePortCoder decodeInvocation]: no local target
    *** NSDistantObject initWithCoder: 0x2 not given away for conn
    0x1515e1f0
    *** -[NSConcretePortCoder decodeInvocation]: no local target

    I have tried few way to circumvent the issue, like invalidating ports
    instead of the connection or continuing running the runloop before
    existing the thread (but as there are are no more input sources the
    runloop return immediately)

    I am looking for ways to terminate the connection without the exception.

    Thanks

    Guy Meyer
  • Guy, what calls are you using to create the NSSocketPort (i suppose
    your are using socket port instead of mach port)
    initWith??????????, and please give the parameters your are using too.

    I had this problem I suceeded to fix.

    Aurélien,
    Objective Decision Team

    On 18 nov. 07, at 22:00, Guy Meyer wrote:

    > My client server application communicate over sockets  using
    > NSConnection.
    >
    > On the client side, there are multiple threads (not the main
    > thread), communicating with the server.
    >
    > Each thread has a single NSConnection. The connection is terminated
    > by issuing an invalidate method on the connection and the thread is
    > existed.
    >
    > On Tiger there is no problem with said architecture.
    >
    > On Leopard few seconds after the thread being terminated, all other
    > threads (which contains an active NSConnection to the server)
    > receives the following exception (if there are no more threads
    > connected to the same server, the exception does not occur - in this
    > example there 3 threads which receive the exception):
    >
    > *** NSDistantObject initWithCoder: 0x3 not given away for conn
    > 0x1514bde0
    > *** -[NSConcretePortCoder decodeInvocation]: no local target
    > *** NSDistantObject initWithCoder: 0x4 not given away for conn
    > 0x1514f9d0
    > *** -[NSConcretePortCoder decodeInvocation]: no local target
    > *** NSDistantObject initWithCoder: 0x2 not given away for conn
    > 0x1515e1f0
    > *** -[NSConcretePortCoder decodeInvocation]: no local target
    >
    > I have tried few way to circumvent the issue, like invalidating
    > ports instead of the connection or continuing running the runloop
    > before existing the thread (but as there are are no more input
    > sources the runloop return immediately)
    >
    > I am looking for ways to terminate the connection without the
    > exception.
    >
    > Thanks
    >
    > Guy Meyer
  • The connection is created as follows:

    NSSocketPort *clientPort = [[NSSocketPort alloc]
    initRemoteWithProtocolFamily:PF_INET socketType:SOCK_STREAM
    protocol:IPPROTO_TCP address:serverAddress];
    NSConnection *clientConnection=[[NSConnection alloc]
    initWithReceivePort:nil sendPort:clientPort];
    [clientConnection setRootObject:self];
    [clientConnection setRequestTimeout:2.0];
    [clientConnection setReplyTimeout:5.0];

    Thanks

    Guy

    On Nov 19, 2007, at 1:52 PM, Aurélien Hugelé wrote:

    > Guy, what calls are you using to create the NSSocketPort (i suppose
    > your are using socket port instead of mach port)
    > initWith??????????, and please give the parameters your are using too.
    >
    > I had this problem I suceeded to fix.
    >
    >
    >
    > Aurélien,
    > Objective Decision Team
    >
    >
    >
    >
    > On 18 nov. 07, at 22:00, Guy Meyer wrote:
    >
    >> My client server application communicate over sockets  using
    >> NSConnection.
    >>
    >> On the client side, there are multiple threads (not the main
    >> thread), communicating with the server.
    >>
    >> Each thread has a single NSConnection. The connection is terminated
    >> by issuing an invalidate method on the connection and the thread is
    >> existed.
    >>
    >> On Tiger there is no problem with said architecture.
    >>
    >> On Leopard few seconds after the thread being terminated, all other
    >> threads (which contains an active NSConnection to the server)
    >> receives the following exception (if there are no more threads
    >> connected to the same server, the exception does not occur - in
    >> this example there 3 threads which receive the exception):
    >>
    >> *** NSDistantObject initWithCoder: 0x3 not given away for conn
    >> 0x1514bde0
    >> *** -[NSConcretePortCoder decodeInvocation]: no local target
    >> *** NSDistantObject initWithCoder: 0x4 not given away for conn
    >> 0x1514f9d0
    >> *** -[NSConcretePortCoder decodeInvocation]: no local target
    >> *** NSDistantObject initWithCoder: 0x2 not given away for conn
    >> 0x1515e1f0
    >> *** -[NSConcretePortCoder decodeInvocation]: no local target
    >>
    >> I have tried few way to circumvent the issue, like invalidating
    >> ports instead of the connection or continuing running the runloop
    >> before existing the thread (but as there are are no more input
    >> sources the runloop return immediately)
    >>
    >> I am looking for ways to terminate the connection without the
    >> exception.
    >>
    >> Thanks
    >>
    >> Guy Meyer
    >
  • As a test, please try initWithTCPPort:
    I know you probably want to customize the socket behind, as we all
    do... but it should solve your problem.
    Please report

    Aurélien,
    Objective Decision Team

    On 19 nov. 07, at 20:21, Guy Meyer wrote:

    >
    > The connection is created as follows:
    >
    > NSSocketPort *clientPort = [[NSSocketPort alloc]
    > initRemoteWithProtocolFamily:PF_INET socketType:SOCK_STREAM
    > protocol:IPPROTO_TCP address:serverAddress];
    > NSConnection *clientConnection=[[NSConnection alloc]
    > initWithReceivePort:nil sendPort:clientPort];
    > [clientConnection setRootObject:self];
    > [clientConnection setRequestTimeout:2.0];
    > [clientConnection setReplyTimeout:5.0];
    >
    > Thanks
    >
    > Guy
    >
    >
    > On Nov 19, 2007, at 1:52 PM, Aurélien Hugelé wrote:
    >
    >> Guy, what calls are you using to create the NSSocketPort (i suppose
    >> your are using socket port instead of mach port)
    >> initWith??????????, and please give the parameters your are using
    >> too.
    >>
    >> I had this problem I suceeded to fix.
    >>
    >>
    >>
    >> Aurélien,
    >> Objective Decision Team
    >>
    >>
    >>
    >>
    >> On 18 nov. 07, at 22:00, Guy Meyer wrote:
    >>
    >>> My client server application communicate over sockets  using
    >>> NSConnection.
    >>>
    >>> On the client side, there are multiple threads (not the main
    >>> thread), communicating with the server.
    >>>
    >>> Each thread has a single NSConnection. The connection is
    >>> terminated by issuing an invalidate method on the connection and
    >>> the thread is existed.
    >>>
    >>> On Tiger there is no problem with said architecture.
    >>>
    >>> On Leopard few seconds after the thread being terminated, all
    >>> other threads (which contains an active NSConnection to the
    >>> server) receives the following exception (if there are no more
    >>> threads connected to the same server, the exception does not occur
    >>> - in this example there 3 threads which receive the exception):
    >>>
    >>> *** NSDistantObject initWithCoder: 0x3 not given away for conn
    >>> 0x1514bde0
    >>> *** -[NSConcretePortCoder decodeInvocation]: no local target
    >>> *** NSDistantObject initWithCoder: 0x4 not given away for conn
    >>> 0x1514f9d0
    >>> *** -[NSConcretePortCoder decodeInvocation]: no local target
    >>> *** NSDistantObject initWithCoder: 0x2 not given away for conn
    >>> 0x1515e1f0
    >>> *** -[NSConcretePortCoder decodeInvocation]: no local target
    >>>
    >>> I have tried few way to circumvent the issue, like invalidating
    >>> ports instead of the connection or continuing running the runloop
    >>> before existing the thread (but as there are are no more input
    >>> sources the runloop return immediately)
    >>>
    >>> I am looking for ways to terminate the connection without the
    >>> exception.
    >>>
    >>> Thanks
    >>>
    >>> Guy Meyer
    >>
    >
previous month november 2007 next month
MTWTFSS
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    
Go to today