¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: IBC Version 3.16.0


 

¿ªÔÆÌåÓý

Mark

?

You asked:

?

I don't know if you plan to apply a default port and IP setting in config.ini in the next release to allow scripts to work off the bat or this will be left blank. Should I wait for your next release, before making the relevant adjustment?

?

I don¡¯t intend to make any changes to what¡¯s currently in the config.ini regarding these settings. Very few people use the command server at all, though that might increase a little as a result of the ¡®restart¡¯ command being available. So I think the default that the command server port is zero (ie not listening for connections) is sensible. The local host can always send commands if the command server is enabled, so there is no need for a default for the ControlFrom setting, and indeed there is no viable default other than localhost.

?

So the upshot is that the user will always have to do something in config.ini to use the command server, and won¡¯t be able to use it ¡®out of the box¡¯.

?

Richard

?

?

From: [email protected] <[email protected]> On Behalf Of Mark Murari
Sent: 18 March 2023 07:42
To: [email protected]
Subject: Re: [ibc] IBC Version 3.16.0

?

Hi Richard,?

Fwiw this is my localhost version using socket. Very similar to yours except I prefer context managers and f strings which true pythomistas will insist makes it more pythonic (in case you care a smidgen :)). I don't know if you plan to apply a default port and IP setting in config.ini in the next release to allow scripts to work off the bat or this will be left blank. Should I wait for your next release, before making the relevant adjustment?

import socket

import time

?

# The address and port of the local IBC command server

TCP_IP = '127.0.0.1' #localhost

TCP_PORT = {tbc as in config.ini}

?

# The message to send to the IBC command server to request a restart

RESTART_COMMAND = 'RESTART\n'

?

# The buffer size for receiving data from the IBC command server

BUFFER_SIZE = 1024

?

# Connect to the IBC command server and send the restart command

with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:

? ? sock.connect((IBC_SERVER_ADDRESS, IBC_SERVER_PORT))

? ? sock.sendall(RESTART_COMMAND.encode())

?

? ? # Receive and discard any data from the IBC command server

? ? data = sock.recv(BUFFER_SIZE)

? ? print(f"received data: {data}")

? ? time.sleep(1)

? ? print("closing socket")

?

print("exiting script")

?

Join [email protected] to automatically receive all group messages.