LSL should provide a mechanism to bind a local port (for example 127.0.0.1:1700 through 127.0.0.1:1800) to a chat channel, so that a program on the local machine could write strings to (say) 127.0.0.1:1700 and have them come out on whatever channel the script specified, as if you had said them, and have messages on the channel be written back to the program over the port.
For example:
CODE
state_entry()
{
llBindSocket(123456,2); // Bind channel 123456 to socket 2 (port 1702).
}
Then you could use this POSIX C program to write "Hello Second Life" on channel 123456:
CODE
This program would work on Mac OS X or Linux directly, and on Windows with the aid of something like Cygwin, U/Win, or Microsoft's own Interix. The comparable Windows native code ouldn't be much more complicated, and you could even test it with
main()
{
char *message="Hello Second Life\n";
integer sock = socket(AF_INET,SOCK_STREAM,0);
struct sockaddr_in addr;
fill_sockaddr_in(&addr,inet_addr("127.0.0.1"),htons(1702));
if(sock < 0 || connect(sock,&addr,sizeof addr) < 0)
{
perror("connect socket");
exit(1);
}
write(sock,message,strlen(message));
close(sock);
exit(0);
}
CODE
C:> TELNET LOCALHOST 1702
Hello Second Life!
^]telnet> quit
C:>
By bindng to localhost (127.0.0.1) you could guarantee that no-one on the internet could sneak in to the port, it would only be able to get connections from programs running on the same computer. For additional security, you could have a preference in the client (the SL application on your PC) to allow it ALWAYS, NEVER, or ASK FOR PERMISSION.