Find and share HowTos to various installations / configurations!
EER
Posts: 17 Joined: Fri Jun 12, 2015 1:31 pm
CTRL script listing on TCP port
Post
by EER » Mon Nov 14, 2022 2:24 pm
Hi,
Is it possible to listen on a TCP port?
I imagine it would be a simple function like:
Code: Select all
int socket = TcpBind(127.0.0.1, 4567);
while (true)
{
anytype data;
int readResult = TcpSocketRead(socket, any);
DebugTN(data);
}
But I have not found something equivalent.
adaneau
Posts: 310 Joined: Tue Feb 21, 2012 9:49 am
Re: CTRL script listing on TCP port
Post
by adaneau » Mon Nov 14, 2022 3:57 pm
kilianvp
Posts: 443 Joined: Fri Jan 16, 2015 10:29 am
Re: CTRL script listing on TCP port
Post
by kilianvp » Tue Nov 15, 2022 2:07 pm
No, you can not create sockets (like a server). There are only functions for the client part. The closest thing is CtrlHTTP. You can create a HTTP server or websockets.
gschijndel
Posts: 376 Joined: Tue Jan 15, 2019 3:12 pm
Re: CTRL script listing on TCP port
Post
by gschijndel » Fri Nov 18, 2022 12:17 pm
Perhaps it is an option to use UDP instead. With
udpOpen it is possible to open a listening socket.