-
Notifications
You must be signed in to change notification settings - Fork 65
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
Port Binding Issues - Stopping playmode does not seem to close ports #34
Comments
Does it reproduce with the sample project in this repository? |
I have so far not being able to do such, however I have not tested extensively yet. |
Also have this |
OK, this happens only with certain ports that are not supposed to be used for OSC. Try changing them. |
@antoniohof what port do you use? I have been hitting this problem very explicity, to the point where if I run anything in edit mode, I have to restart unity every time I save a file :/ |
As cabbibo says, can you share what ports work for you? I am having the same problem. Is there maybe some way to close existing ports manually? |
OK, It was my own fault. For my custom event receiver I copied the RegisterCallback() and UnregisterCallback() Logic from the OSCEventReceiver. But somehow I forgot to call the UnregisterCallback on OnDisable(). After adding that, it works fine again. Edit: |
Port number seems to not matter! however, there are some times when it
seems like the callback is not being unregistered before the new callback
tries to register? I've dug down into it not having a list of servers
OnEnable, but still having a bound port, but can't figure out what isn't
getting called...
…On Tue, Mar 21, 2023 at 4:52 AM Tehenauin ***@***.***> wrote:
OK, It was my own fault.
In my case it didn't have to do anything with the port number. (I am using
port 1234)
For my custom event receiver I copied the RegisterCallback() and
UnregisterCallback() Logic from the OSCEventReceiver. But somehow I forgot
to call the UnregisterCallback on OnDisable(). After adding that, it works
fine again.
—
Reply to this email directly, view it on GitHub
<#34 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAG6SWRUM6JQG7ABOLNWYFTW5GI7TANCNFSM5U2J2XQQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
My 'Work Around' is to just have an editor script that gives me a button
that I press to reconnect whenever it disconnects ( sometimes, but not all
the time when scripts save ) Its definitely strange behavoir
On Tue, Mar 21, 2023 at 7:30 AM Isaac Cohen ***@***.***>
wrote:
… Port number seems to not matter! however, there are some times when it
seems like the callback is not being unregistered before the new callback
tries to register? I've dug down into it not having a list of servers
OnEnable, but still having a bound port, but can't figure out what isn't
getting called...
On Tue, Mar 21, 2023 at 4:52 AM Tehenauin ***@***.***>
wrote:
> OK, It was my own fault.
> In my case it didn't have to do anything with the port number. (I am
> using port 1234)
>
> For my custom event receiver I copied the RegisterCallback() and
> UnregisterCallback() Logic from the OSCEventReceiver. But somehow I forgot
> to call the UnregisterCallback on OnDisable(). After adding that, it works
> fine again.
>
> —
> Reply to this email directly, view it on GitHub
> <#34 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAG6SWRUM6JQG7ABOLNWYFTW5GI7TANCNFSM5U2J2XQQ>
> .
> You are receiving this because you commented.Message ID:
> ***@***.***>
>
--
http://cabbi.bo
|
I think I found a soloution. Since unity doesn't call the servers dispose method (which is in charge of closing the running Thread), you have to do it by yourself. Easiest is probably to call it from a monobehaviours OnDestroy method. Ideally the behaviour that creates the server. For me it looks like this:
I hope this is the correct answer. But so far its looking good. |
As the title describes, I have been having issues with starting playmode with OscJack (and OscJackVS) where, after ending playmode and starting it again, it would not be able to open the ports and would complain about them already being bound to. A full restart of Unity is required to work around this issue, and it is not consistent in every case - sometimes restarting works again, sometimes it does not.
Unity Version : 2021.3.0f1
The text was updated successfully, but these errors were encountered: