Giter VIP home page Giter VIP logo

pyesl's People

Contributors

sjthomason avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pyesl's Issues

Handle outbound socket connection with file descriptor

The example in wiki is like this:-

import SocketServer
import ESL
 
class ESLRequestHandler(SocketServer.BaseRequestHandler):
    def setup(self):
        print self.client_address, 'connected!'
 
        fd = self.request.fileno()
        print fd
 
        con = ESL.ESLconnection(fd)
        print 'Connected: ', con.connected()
        if con.connected():
 
            info = con.getInfo()
 
            uuid = info.getHeader("unique-id")
            print uuid
            con.execute("answer", "", uuid)
            con.execute("playback", "/ram/swimp.raw", uuid);
         
# server host is a tuple ('host', port)
server = SocketServer.ThreadingTCPServer(('', 8040), ESLRequestHandler)
server.serve_forever()

ESL.ESLconnection() being passed a file descriptor. The current ESLconnection.__init__(self, host, port, password) seem not supporting this.

The __init__ signature for official lib:-

class ESLconnection(builtins.object)
 |  Methods defined here:
 |
 |  __del__ lambda self
 |
 |  __getattr__ lambda self, name
 |
 |  __init__(self, *args)

And the corresponding cpp source:-

ESLconnection::ESLconnection(int socket)
{
	connection_construct_common();
	esl_attach_handle(&handle, (esl_socket_t)socket, NULL);
}

possible infinite loop in sendRecv?

What prevents sendRecv from becoming an infinity loop if self.__event_queue is empty and it gets an event with the a content type other than "api/response" or "command/reply"?

If I'm reading your code correctly (and I'm not sure that I am) then sendRecv would store this event in self.__event_queue and then call self.recvEvent() which grabs the just stored event from the queue and returns it again.

Is there something I'm missing?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.