Hi,
Here is the script that I use using irc.client, only to listen my server :
def listen_to(connection):
soc = connection.socket
buf = ''
while connection.is_connected():
buf += soc.recv(1024).decode("utf-8")
print(buf)
def main():
args = parse_args()
port = args.port
nickname = args.nickname
target = args.channel
server = args.host
password = None if not args.password else args.password
reactor = irc.client.Reactor()
try:
c = reactor.server()
c.connect(server, port, nickname,password=password)
c.join(target)
c.set_keepalive(5)
listen_to(c)
except irc.client.ServerConnectionError:
print(sys.exc_info()[1])
raise SystemExit(1)
reactor.process_forever()
if __name__ == '__main__':
main()
I read the old issues, and found out a set_keepalive was added, but my server still close the connection after the ping time runs out ( ping timeout). I try to explore the library, and changed ping time from my ircd-hybridserver, the same error appears :
Sorry, I apologize, I forgot to wrap the listen_to() function into a thread, otherwise it run out into an infinite loop and process_forever is never executed
Hi, Here is the script that I use using irc.client, only to listen my server :
I read the old issues, and found out a set_keepalive was added, but my server still close the connection after the ping time runs out ( ping timeout). I try to explore the library, and changed ping time from my
ircd-hybrid
server, the same error appears :Thanks for your help, you made an excellent job !