dictation-toolbox / aenea

Client-server library for using voice macros from Dragon NaturallySpeaking and Dragonfly on remote/non-windows hosts.
GNU Lesser General Public License v3.0
211 stars 62 forks source link

`Aenea: Successfully connected to server.` printed when not connected to server #183

Open dylan-chong opened 6 years ago

dylan-chong commented 6 years ago

If I don't even start the Aenea server, Aenea: Successfully connected to server. is printed to the natlink console when i open dragon, incorrectly, at line 2 https://github.com/dictation-toolbox/aenea/blob/master/client/_aenea.py#L54

LexiconCode commented 6 years ago

I can concur that this is an issue that I'm experiencing as well.

calmofthestorm commented 6 years ago

Is anything else being printed? Wondering if this is the problem: https://github.com/dictation-toolbox/aenea/blob/master/client/aenea/communications.py#L97

Socket error is caught and we return None, which then gets converted into an empty context of {}. Since the printed message you note is just testing the absence of a general except:, it still gets printed.

If this is the problem, the solution should be to either use a smarter/more explicit check that the connection is up (this state is being tracked in the Proxy as part of retry and cooldown, so maybe we should just add a method to check directly?), or to propagate the socket.error exception (but I worry that could introduce further issues for intermittant problems or when using multiple servers on different computers, if things expect socket.error to be swallowed).

dylan-chong commented 6 years ago

Socket error connecting to aenea server. To avoid slowing dictation, we won\'t try again for %i seconds doesn't get printed until i try to say a command

This text comes up when i open dragon without the server started

 -- natlinkmain starting...
--- natlinkstartup starting...
======
SendInput, a Vocola extension written by Mark Lillibridge,  is 
used for all normal playString calls!  If you do not want this,
change the variable useMarkSendInput to 0 in line 65 of
natlinkutils.py.  This file is located in the directory 
NatLink\MacroSystem\Core.  Then restart Dragon...
======
Vocola not active
Aenea client-side modules loaded successfully
Settings:
    HOST: 192.168.56.1
    PORT: 8240
    PLATFORM: proxy
    USE_MULTIPLE_ACTIONS: True
    SCREEN_RESOLUTION: [6400, 1440]
Aenea: Successfully connected to server.
Loading _charwise_vim.py
Aenea hello world grammar: Loaded.
natlinkmain started from C:\NatLink\NatLink\MacroSystem\core:
  NatLink version: 4.1whiskey
  DNS version: 13
  Python version: 27
  Windows Version: 7
----------------------------------------
calmofthestorm commented 6 years ago

Hmmm ok, I'll try to take a look at this when I have a chance, but I'm about to head out of town for awhile so it might be a few weeks.

dylan-chong commented 6 years ago

Thanks, no rush.

On 21/11/2018, at 3:12 PM, Alex Roper notifications@github.com wrote:

Hmmm ok, I'll try to take a look at this when I have a chance, but I'm about to head out of town for awhile so it might be a few weeks.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dictation-toolbox/aenea/issues/183#issuecomment-440502776, or mute the thread https://github.com/notifications/unsubscribe-auth/AQrCbThAmdJj0sByhPpZzCvloyvPjduIks5uxLZ0gaJpZM4Ynt-o.