Hi Michael,
here's the kicker, I got it working. My uname -a the OS I'm writing this
mail on: Linux ronald 2.5.42 #3 SMP Mon Oct 14 13:15:37 MDT 2002 i686
unknown
My son, also a Michael btw, is sick and I didn't get much sleep the last
two nights.  So take this with a grain of salt, I might be out of it. 
But anyway, he's sleeping right now. So I decided to do a quick test.

Here's what I changed in ../libs/ORBit-0.5.1[5,6]/src/IIOP connection.c

/*
 * iiop_connection_unix_get
 *
 *   Inputs: 'sockpath' - Of the format 'path'
 *
 *   Outputs: 'cnx' - the connection to the specified path, or
 *             NULL upon error.
 *
 *    Description: Returns an IIOPConnection that is connected to the
 *                 specified UNIX socket, if possible. If a connection
 *                 already exists, just returns it. Otherwise,
 *                 calls 'iiop_connection_unix_new' to create a new
 *                 connection to sockpath.
 */
IIOPConnection *
iiop_connection_unix_get(const char *sockpath, gboolean existing_only)
{
  IIOPConnection *cnx = NULL, *tmp;
  GList *link;
  int test = 0;

  GET_LOCK(giop_connection_list);
  for(link = giop_connection_list.list; link; link = link->next)
    {
      tmp = IIOP_CONNECTION(link->data);

      if(GIOP_CONNECTION(tmp)->connection_type != GIOP_CONNECTION_IIOP)
        continue;

      if(!GIOP_CONNECTION(tmp)->is_valid)
        continue;

      if(GIOP_CONNECTION(tmp)->connection_class !=
GIOP_CONNECTION_CLIENT)
        continue;

      if(IIOP_CONNECTION(tmp)->icnxtype != IIOP_USOCK)
        continue;

      if(!strcmp(sockpath, tmp->u.usock.sun_path)) {
        cnx = test ? tmp : NULL;
        if(!test) continue;
        break;
      }
    }
  RELEASE_LOCK(giop_connection_list);

  if(!cnx && !existing_only)
    cnx = iiop_connection_unix_new(sockpath);

  return cnx;
}


As you see I just added a test for debugging, well it works. Now why I
still don't know.

Have fun,
Ronald







On Mon, 2002-10-28 at 04:17, Michael Meeks wrote:
> Hi Ronald,
> 
>       Firstly - thanks for looking into this.
> 
> On Fri, 2002-10-25 at 17:42, Ronald Kuetemeier wrote:
> > Ok, let's see if I can explain this.
> > Look at file ORBit-0.5.1[5,6]/src/IIOP/connection.c:(IIOPConnection *
> > iiop_connection_unix_get:923)
> 
>       Ok.
> 
> > In 2.4 all test in the for loop will fail since none is set to
> > GIOP_CONNECTION_CLIENT therefore the variable cnx is not set and the
> > socket, btw existing and if the strcmp would ever be reached would also
> > succeed (that's why I call it a server), is opened.  
> ...
> > In 2.5 the connection is set to be of class GIOP_CONNECTION_CLIENT
> > the strcmp succeeds variable is set and the connection is never opened.
> 
>       Ok - this is quite likely just down to a race condition in who gets
> timesliced first, and thus who connects to wherever when - presumably.
> 
> > There is also some strange difference in the number or ordering in the
> > list. In 2.5 it's the first socket in the list (I didn't check if there
> > are more or just that one), in 2.4 it's the last one (there are more
> > before it, just look at the socket path from the sockets tested during
> > the loop execution)
> 
>       Ok - this is really down to the order in which what process
> communicates with what other process - so ... it's rather hard to tell
> whether that's meaningful really.
> 
> > BTW. My definition of server is, I call you to serve me something. If
> > you call me I become the server for you. If I call you to put my UI on
> > the screen you're the server. The screwed up definition from Oracle,
> > Microsoft and Sun from the 80's never worked for me anyway.   
> 
>       Yes - but you realise that the ORB has no interest in putting the UI on
> the screen; and as such it's 'client/server' distinction is just a
> matter of who is listening for connections and who is not; ie a server
> has many clients, a client has a single server. [ although a process
> clearly has ~1 Unix socket server, and multiple clients to other
> processes ].
> 
>       HTH & keep digging,
> 
>       Thanks,
> 
>               Michael.
> 


_______________________________________________
evolution-hackers maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/evolution-hackers

Reply via email to