CTRL script listing on TCP port

Find and share HowTos to various installations / configurations!
4 posts • Page 1 of 1
EER
Posts:17
Joined: Fri Jun 12, 2015 1:31 pm

CTRL script listing on TCP port

Post by EER »

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 »

Hey,

Just have a look into TCP functions.
https://www.winccoa.com/documentation/W ... pRead.html

BR
Alex

kilianvp
Posts:443
Joined: Fri Jan 16, 2015 10:29 am

Re: CTRL script listing on TCP port

Post by kilianvp »

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 »

Perhaps it is an option to use UDP instead. With udpOpen it is possible to open a listening socket.

4 posts • Page 1 of 1