Open Nolram12345 opened 2 years ago
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 :/
OK, this happens only with certain ports that are not supposed to be used for OSC. Try changing them.
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. 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.
Edit: I take it back, it is still not working. It just appears quite irregularly.
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 https://github.com/keijiro/OscJack/issues/34#issuecomment-1477702709, 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 https://github.com/keijiro/OscJack/issues/34#issuecomment-1477702709, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAG6SWRUM6JQG7ABOLNWYFTW5GI7TANCNFSM5U2J2XQQ . You are receiving this because you commented.Message ID: @.***>
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:
private void OnDestroy()
{
var server = OscMaster.GetSharedServer(currentPort);
server?.Dispose();
}
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