python-eel / Eel

A little Python library for making simple Electron-like HTML/JS GUI apps
MIT License
6.44k stars 587 forks source link

@eel.expose multiple calls #457

Closed jdauthre closed 3 years ago

jdauthre commented 3 years ago

I have an application that gets a set of video streams from websites and plays them through an iframe element. It wotks well except that if I play one and then try another I get an error: OSError: [WinError 10048] Only one usage of each socket address (protocol/network address/port) is normally permitted: ('localhost', 8000) So I have to restart the whole application.

The script has :
eel.init('web') @eel.expose

at the beginning of the main script and the following method is called def getValue(): return streaming # the url of the video Then: eel.start('getTheUrl.html', block=False,cmdline_args=['--start-fullscreen'] ) eel.sleep(5.0)

So I presume I need to close the socket before loading another video? and / or "unexpose" (if there is such a word!) @eel.expose? But I have no idea how to go about this. Thanks in advance Desktop Windows10 Chrome Version 88.0.4324.190 (Official Build) (64-bit)

rahmatagungj commented 3 years ago

You have to make sure the socket is not closed while the application is running, or opens when the application is closed.