Open vivi90 opened 2 years ago
An time delay solves only the error message in the logs but still nothing is sent 🙁
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""``osc4py3.as_comthreads`` example."""
from time import sleep
# Logging
from logging import (
basicConfig as set_logger_config,
getLogger as get_logger,
DEBUG as LOGLEVEL_DEBUG
)
FRM = "%(asctime)s - %(threadName)s ø %(name)s - %(levelname)s - %(message)s"
set_logger_config(
filename="osc.log",
filemode='a',
encoding="utf-8",
format=FRM
)
logger = get_logger("osc")
logger.setLevel(LOGLEVEL_DEBUG)
# ``osc4py3``
from osc4py3.as_comthreads import *
from osc4py3 import oscbuildparse
osc_startup(logger=logger)
# Make client channels to send packets.
osc_udp_client("127.0.0.1", 39540, "local")
# Build a simple message and send it.
msg = oscbuildparse.OSCMessage("/test/me", ",sif", ["text", 672, 8.871])
osc_send(msg, "local")
osc_process()
sleep(5)
osc_process()
osc_terminate()
2022-07-25 17:41:10,372 - MainThread ø osc - DEBUG - monitor 2255519411712 created (SelectSocketMonitor).
2022-07-25 17:41:10,375 - RawPackThread ø osc - INFO - OSC Starting rawpackets_process_loop()
2022-07-25 17:41:10,376 - SendPackThread ø osc - INFO - OSC Starting sendingpackets_process_loop()
2022-07-25 17:41:10,375 - SocketThread ø osc - INFO - OSC Monitoring thread started for monitor 2255519411712.
2022-07-25 17:41:10,377 - SocketThread ø osc - DEBUG - monitor 2255519411712 wait sockets(r[744] w[] e[] 60.0).
2022-07-25 17:41:10,378 - DelayThread ø osc - INFO - OSC Starting delayed_process_loop()
2022-07-25 17:41:10,379 - MainThread ø osc - INFO - OSC channel 'local' setup as writer.
2022-07-25 17:41:10,380 - MainThread ø osc - DEBUG - OSC opening channel 'local'.
2022-07-25 17:41:10,380 - MainThread ø osc - INFO - UDP channel 'local' open write on ('0.0.0.0', 0) target AddrInfo(family=<AddressFamily.AF_INET: 2>, socktype=<SocketKind.SOCK_DGRAM: 2>, proto=17, canonname='127.0.0.1:39540', sockaddr=('127.0.0.1', 39540)).
2022-07-25 17:41:10,381 - MainThread ø osc - INFO - OSC channel 'local' activated.
2022-07-25 17:41:10,381 - MainThread ø osc - DEBUG - OSC scheduling channel 'local'.
2022-07-25 17:41:10,381 - MainThread ø osc - INFO - OSC channel 'local' scheduled.
2022-07-25 17:41:10,381 - SendPackThread ø osc - DEBUG - OSC send packets processing SendingPacket(packet=OSCMessage(addrpattern='/test/me', typetags=',sif', arguments=['text', 672, 8.871]), packopt=<osc4py3.oscpacketoptions.PacketOptions object at 0x0000020D2776B040>, targets={'local'})
2022-07-25 17:41:10,382 - SendPackThread ø osc - DEBUG - OSC packet_send_function to targets {'local'} with OSCMessage(addrpattern='/test/me', typetags=',sif', arguments=['text', 672, 8.871])
2022-07-25 17:41:10,382 - SendPackThread ø osc - DEBUG - OSC transmit_rawpacket to channels {'local'}
2022-07-25 17:41:10,382 - SendPackThread ø osc - DEBUG - OSC channel 'local' transmit_data via write_pending queue
2022-07-25 17:41:10,383 - SendPackThread ø osc - DEBUG - OSC channel 'local' another write packet available
2022-07-25 17:41:10,383 - SendPackThread ø osc - DEBUG - OSC channel 'local' schedule of packet to write
2022-07-25 17:41:15,381 - MainThread ø osc - DEBUG - OSC unscheduling channel 'local'.
2022-07-25 17:41:15,381 - MainThread ø osc - INFO - OSC channel 'local' unscheduled.
2022-07-25 17:41:15,381 - MainThread ø osc - DEBUG - OSC closing channel 'local'.
2022-07-25 17:41:15,381 - MainThread ø osc - INFO - UDP channel 'local' closed.
2022-07-25 17:41:15,381 - MainThread ø osc - INFO - OSC channel 'local' deactivated.
2022-07-25 17:41:15,382 - MainThread ø osc - DEBUG - monitor 2255519411712 request to terminate.
2022-07-25 17:41:15,382 - SendPackThread ø osc - INFO - OSC Finishing sendingpackets_process_loop()
2022-07-25 17:41:15,382 - SocketThread ø osc - INFO - monitor 2255519411712 terminating.
2022-07-25 17:41:15,383 - RawPackThread ø osc - INFO - OSC Finishing rawpackets_process_loop()
2022-07-25 17:41:15,383 - SocketThread ø osc - INFO - OSC Monitoring thread terminated for monitor 2255519411712.
2022-07-25 17:41:15,383 - DelayThread ø osc - INFO - OSC Finishing delayed_process_loop()
1.0.8
3.10.4
Version 21H2 (Build 19044.1826)
With version 1.0.1
and 1.0.3
it works perfectly fine.
It's broken since 1.0.4
like mentioned in https://github.com/Xinne/osc4py3/issues/4#issuecomment-409595319.
$ pip install osc4py3==1.0.3
Please fix this issue, if possible 🙂
Code
Using the code from an old closed issue as an example for testing:
Problem
If iam replacing
from osc4py3.as_comthreads import *
byfrom osc4py3.as_eventloop import *
it works as expected. But withas_comthreads
it sends nothing. Also i get no error message without usinglogging
. In the logging it seems to me, that it closes the channel before finished:So seems related to issues https://github.com/Xinne/osc4py3/issues/4 and https://github.com/Xinne/osc4py3/issues/2.
Logs
With
as_comthreads
(not working)With
as_eventloop
(working)System
1.0.8
3.10.4
Version 21H2 (Build 19044.1826)