Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

select.error: (4, 'Interrupted system call') #60

Open
mohamad-hasan-sohan-ajini opened this issue Sep 9, 2017 · 0 comments
Open

select.error: (4, 'Interrupted system call') #60

mohamad-hasan-sohan-ajini opened this issue Sep 9, 2017 · 0 comments

Comments

@mohamad-hasan-sohan-ajini

Hi

I want to use websocket for Automatic Speech Recognition (ASR) server side. I try to load models in __init__. After the models loaded successfully,the following exception thrown out:

Selected GPU[0] GeForce GTX 1060 6GB as the process wide default device.
ASR model loaded successfully
(('127.0.01', 56236), 'connected')
Traceback (most recent call last):
File "websocket_server2.py", line 111, in
server.serveforever()
File "/home/aj/anaconda3/envs/cntk-py27/lib/python2.7/site-packages/SimpleWebSocketServer/SimpleWebSocketServer.py", line 677, in serveforever
self.serveonce()
File "/home/aj/anaconda3/envs/cntk-py27/lib/python2.7/site-packages/SimpleWebSocketServer/SimpleWebSocketServer.py", line 618, in serveonce
rList, wList, xList = select(self.listeners, writers, self.listeners, self.selectInterval)
select.error: (4, 'Interrupted system call')

My class defined as bellow:

# -*- coding: utf-8 -*-
from SimpleWebSocketServer import SimpleWebSocketServer, WebSocket
from ASR import ASR


class SimpleEcho(WebSocket):

    def __init__(self, server, sock, address):
        super(SimpleEcho, self).__init__(server, sock, address)
        self.asr = ASR()

    def handleMessage(self):
        data = np.frombuffer(self.data, 'i2')
        result = self.asr(data)
        self.sendMessage(unicode(result))

    def handleConnected(self):
        print(self.address, 'connected')
        self.sendMessage(unicode('connection stablished...'))

    def handleClose(self):
        print(self.address, 'connection closed')
        self.sendMessage(unicode('connection closed...'))

server = SimpleWebSocketServer('0.0.0.0', 8081, SimpleEcho)
server.serveforever()

What cause such exception and how can I avoid it?
regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant