SimpleXMLRPCServer

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Yannick Turgeon

    #1

    SimpleXMLRPCServer

    I plan to use XML-RPC to communicate between my python server and VB client.
    I just called a simple registered function (lambda x,y: x+y) and it worked.
    But I'm new to XML-RPC and I'm now wondering why this class is called
    "Simple". What are its limitations? I want to know if I can count on it for
    my project or if I would need a not-so-simple XML-RPC server.

    Yannick


  • Istvan Albert

    #2
    Re: SimpleXMLRPCSer ver

    Yannick Turgeon wrote:
    [color=blue]
    > "Simple". What are its limitations?[/color]

    No limitations whatsoever ... it is "Simple" to use

    :-0

    Istvan.

    Comment

    • Jeremy Jones

      #3
      Re: SimpleXMLRPCSer ver

      Istvan Albert wrote:
      [color=blue]
      > Yannick Turgeon wrote:
      >[color=green]
      >> "Simple". What are its limitations?[/color]
      >
      >
      > No limitations whatsoever ... it is "Simple" to use
      >
      > :-0
      >
      > Istvan.
      >[/color]
      Simple indeed. I don't know for sure the reasons for naming it
      "Simple". But it may have to do with the fact that the out-of-the-box
      SimpleXMLRPCSer ver will only handle one request at a time: a request
      comes in, the server accepts that request, blocking until the method
      call returns, and the response is sent back to the client. It does not
      spawn a thread per request. It does not "select" among multiple
      requests. It will not create a thread pool for you. If you want that
      added functionality, you can write a little custom code to get it to
      spawn a thread per request. A little more code to only spawn n number
      of threads. A little more code still to create a thread pool. And if
      you want a server that "select"s among multiple requests, I'm not 100%
      sure, but I bet Twisted has one of those.

      But I've got a good bit of confidence in the "SimpleXMLRPCSe rver." I've
      written a small modification to spawn a thread per request and am about
      to write a test harness to pound my underlying library to pieces through
      the slightly modified SimpleXMLRPCSer ver. I'm hopeful for good results
      - at least in robustness if not performance.

      HTH,

      Jeremy

      Comment

      • PhysicsGenius

        #4
        Re: SimpleXMLRPCSer ver

        Jeremy Jones wrote:[color=blue]
        > Istvan Albert wrote:
        >[color=green]
        >> Yannick Turgeon wrote:
        >>[color=darkred]
        >>> "Simple". What are its limitations?[/color]
        >>
        >>
        >>
        >> No limitations whatsoever ... it is "Simple" to use
        >>
        >> :-0
        >>
        >> Istvan.
        >>[/color]
        > Simple indeed. I don't know for sure the reasons for naming it
        > "Simple". But it may have to do with the fact that the out-of-the-box
        > SimpleXMLRPCSer ver will only handle one request at a time: a request
        > comes in, the server accepts that request, blocking until the method
        > call returns, and the response is sent back to the client. It does not
        > spawn a thread per request. It does not "select" among multiple
        > requests. It will not create a thread pool for you. If you want that
        > added functionality, you can write a little custom code to get it to
        > spawn a thread per request. A little more code to only spawn n number
        > of threads. A little more code still to create a thread pool. And if
        > you want a server that "select"s among multiple requests, I'm not 100%
        > sure, but I bet Twisted has one of those.[/color]

        I have a non-threaded, select()ing SimpleXML-RPC
        server. I have stressed it yet, but I have
        verified that the concept works.

        Comment

        • Jeremy Jones

          #5
          Re: SimpleXMLRPCSer ver

          PhysicsGenius wrote:
          [color=blue]
          > Jeremy Jones wrote:
          >[color=green]
          >> Istvan Albert wrote:
          >>[color=darkred]
          >>> Yannick Turgeon wrote:
          >>>
          >>>> "Simple". What are its limitations?
          >>>
          >>>
          >>>
          >>>
          >>> No limitations whatsoever ... it is "Simple" to use
          >>>
          >>> :-0
          >>>
          >>> Istvan.
          >>>[/color]
          >> Simple indeed. I don't know for sure the reasons for naming it
          >> "Simple". But it may have to do with the fact that the
          >> out-of-the-box SimpleXMLRPCSer ver will only handle one request at a
          >> time: a request comes in, the server accepts that request, blocking
          >> until the method call returns, and the response is sent back to the
          >> client. It does not spawn a thread per request. It does not
          >> "select" among multiple requests. It will not create a thread pool
          >> for you. If you want that added functionality, you can write a
          >> little custom code to get it to spawn a thread per request. A little
          >> more code to only spawn n number of threads. A little more code
          >> still to create a thread pool. And if you want a server that
          >> "select"s among multiple requests, I'm not 100% sure, but I bet
          >> Twisted has one of those.[/color]
          >
          >
          > I have a non-threaded, select()ing SimpleXML-RPC server. I have
          > stressed it yet, but I have verified that the concept works.[/color]

          Is this something that you wrote, or are you using Twisted? If it's
          something you wrote, I'd love to see the code for it.

          Jeremy

          Comment

          • Rembrandt Q Einstein

            #6
            Re: SimpleXMLRPCSer ver

            Jeremy Jones wrote:[color=blue]
            > PhysicsGenius wrote:
            >[color=green]
            >> Jeremy Jones wrote:
            >>[color=darkred]
            >>> Istvan Albert wrote:
            >>>
            >>>> Yannick Turgeon wrote:
            >>>>
            >>>>> "Simple". What are its limitations?
            >>>>
            >>>>
            >>>>
            >>>>
            >>>>
            >>>> No limitations whatsoever ... it is "Simple" to use
            >>>>
            >>>> :-0
            >>>>
            >>>> Istvan.
            >>>>
            >>> Simple indeed. I don't know for sure the reasons for naming it
            >>> "Simple". But it may have to do with the fact that the
            >>> out-of-the-box SimpleXMLRPCSer ver will only handle one request at a
            >>> time: a request comes in, the server accepts that request, blocking
            >>> until the method call returns, and the response is sent back to the
            >>> client. It does not spawn a thread per request. It does not
            >>> "select" among multiple requests. It will not create a thread pool
            >>> for you. If you want that added functionality, you can write a
            >>> little custom code to get it to spawn a thread per request. A little
            >>> more code to only spawn n number of threads. A little more code
            >>> still to create a thread pool. And if you want a server that
            >>> "select"s among multiple requests, I'm not 100% sure, but I bet
            >>> Twisted has one of those.[/color]
            >>
            >>
            >>
            >> I have a non-threaded, select()ing SimpleXML-RPC server. I have
            >> stressed it yet, but I have verified that the concept works.[/color]
            >
            >
            > Is this something that you wrote, or are you using Twisted? If it's
            > something you wrote, I'd love to see the code for it.
            >
            > Jeremy
            >[/color]

            Maybe "server" is too grand a term. This is running inside an actual
            server, but this is really just a snippet of code for doing select() on
            an XML-RPC server socket.

            server = XMLRPCServer.XM LRPCServer((ipA ddr, port), logRequests=Fal se)
            while(True):
            inputs, outputs, exceptions =
            select.select([server.fileno() ,],[], [],
            configOptions['tick'])
            if inputs:
            server.handle_r equest()

            Comment

            • Brian Quinlan

              #7
              Re: SimpleXMLRPCSer ver

              Jeremy Jones wrote:[color=blue]
              > Istvan Albert wrote:
              >[color=green]
              >> Yannick Turgeon wrote:
              >>[color=darkred]
              >>> "Simple". What are its limitations?[/color]
              >>
              >>
              >>
              >> No limitations whatsoever ... it is "Simple" to use
              >>
              >> :-0
              >>
              >> Istvan.
              >>[/color]
              > Simple indeed. I don't know for sure the reasons for naming it
              > "Simple". But it may have to do with the fact that the out-of-the-box
              > SimpleXMLRPCSer ver will only handle one request at a time: a request
              > comes in, the server accepts that request, blocking until the method
              > call returns, and the response is sent back to the client. It does not
              > spawn a thread per request.[/color]

              The name SimpleXMLRPCSer ver is in line with SimpleHTTPServe r: a simple
              serial request handling server that can be subclassed to provide
              additional functionality. I also chose SimpleXMLRPCSer ver because I
              reasoned that some day someone would want to write a server using a
              different technique and SimpleXMLRPCSer ver could be refactored into
              BaseXMLRPCServe r and SimpleXMLRPCSer ver without breaking anything. That
              would allow NewXMLRPCServer to leverage the new BaseXMLRPCServe r.

              Cheers,
              Brian

              Comment

              • Yannick Turgeon

                #8
                Re: SimpleXMLRPCSer ver

                "Jeremy Jones" <zanesdad@bells outh.net> wrote in message
                news:mailman.39 83.1096327706.5 135.python-list@python.org ...[color=blue][color=green]
                > > Yannick Turgeon wrote:[color=darkred]
                > >> "Simple". What are its limitations?[/color]
                > >[/color]
                > Simple indeed. I don't know for sure the reasons for naming it
                > "Simple". But it may have to do with the fact that the out-of-the-box
                > SimpleXMLRPCSer ver will only handle one request at a time[/color]

                Oh! Ok, that's good. Thanks.

                Yannick


                Comment

                • Skip Montanaro

                  #9
                  Re: SimpleXMLRPCSer ver


                  Jeremy> ... the out-of-the-box SimpleXMLRPCSer ver will only handle one
                  Jeremy> request at a time... It does not spawn a thread per request.

                  Nor should it. Enabling threading in an application should be an active
                  step taken by the programmer, not a passive step taken as a side effect of
                  using a particular class that doesn't mention threading. The simplest part
                  of making a server threaded is mixing in SocketServer.Th readingMixin. Far
                  more work needs to be done to make it robust.

                  Now, should the SimpleXMLRPCSer ver module provide a threaded version?
                  Perhaps. The default should be non-threaded however.

                  Skip

                  Comment

                  • Jeremy Jones

                    #10
                    Re: SimpleXMLRPCSer ver

                    Skip Montanaro wrote:
                    [color=blue]
                    > Jeremy> ... the out-of-the-box SimpleXMLRPCSer ver will only handle one
                    > Jeremy> request at a time... It does not spawn a thread per request.
                    >
                    >Nor should it. Enabling threading in an application should be an active
                    >step taken by the programmer, not a passive step taken as a side effect of
                    >using a particular class that doesn't mention threading. The simplest part
                    >of making a server threaded is mixing in SocketServer.Th readingMixin. Far
                    >more work needs to be done to make it robust.
                    >
                    >Now, should the SimpleXMLRPCSer ver module provide a threaded version?
                    >Perhaps. The default should be non-threaded however.
                    >
                    >Skip
                    >
                    >[/color]
                    I don't disagree at all. The example that I got from somewhere that I
                    still use as my base template to create a threaded XMLRPCServer is all
                    of 6 lines of code. It's trivial. And that could probably be trimmed
                    down a bit.


                    Jeremy

                    Comment

                    Working...