1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 <2024> 2025 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 <2024> 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Managing connections with asyn |
From: | Marco Filho via Tech-talk <tech-talk at aps.anl.gov> |
To: | "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov> |
Cc: | George Kontogiorgos <george.kontogiorgos at ess.eu> |
Date: | Thu, 8 Aug 2024 14:54:42 +0000 |
Hi! printf("###########");
asynUser* pAsynUser_; pasynOctetSyncIO->connect(name, 0, &pAsynUser_, NULL); pasynManager->disconnect(pAsynUser_); printf("###########"); But when I execute the IOC i get nothing in my python port. My ioc terminal prints: (...) drvAsynIPPortConfigure("LOCALHOST", "127.0.0.1:65432", 0, 1, 0)
(...)MyDriverConfig("MYPORT", "LOCALHOST", 1000, 1000, 1, 0, 0) ########### ########### I am still struggling with this because I clearly don't fully understand the differences between asynManager, asynUser, SyncIO, etc... I looked at the examples in the asyn module and in ADmythen module, but they all use asyn AutoConnect (or maybe I missed something). They are good for showing how to write and read trough the code, but I wasn't able to understand how to disconnect and conenct to the port's IP. Can someone explain what am I doing wrong? Thanks in advance :) -------------------------------------- Python server: # echo-server.py
import socket HOST = "127.0.0.1" # Standard loopback interface address (localhost) PORT = 65432 # Port to listen on (non-privileged ports are > 1023) with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: s.bind((HOST, PORT)) s.listen() conn, addr = s.accept() with conn: print(f"Connected by {addr}") while True: data = ""> if not data: break conn.sendall(data) |