I’m trying to get a working ChatScript client written in Perl, to run on Ubuntu (on a Mac).
The ChatScript server is running on a remote Ubuntu machine in a server farm in Texas.
I don’t do anything fancy. I open a socket to the remote server on port 1024, send my concatenated three null-terminated string, read the reply, close the socket, and loop.
If I run the ChatScript executable with client=<host>:1024, it works fine, from Ubuntu.
But when I try to run my Perl client, it only “sort of works”. The progression of the dialog is correct, but it typically takes two or three or four tries to get what I say to “take”, as I’m getting back the error messages related to connection threads not hooking up with main-threads.
(“Sorry, I got distracted, what did you say? Sorry phone, what did yousay? Sorry Salesan at door, what did you say” type messages.)
Then it “takes” on the next try.
If I send my responses very rapidly, as in “hello” repeatedly, I get back a successful “I don’t know what to say” without intervening “sorry” messages. It’s like the “timeout” is half a second or something.
In fact, it is only a second or less before I get the “sorry” message.
I’ve tried launching the server with “time=3000” as a command line parameter, and it has no effect, meaning I STILL get the “sorry” message back in about a second or less when I type something.
I’m using this:
./LinuxChatScript32 time=3000
Any ideas what I’m doing wrong? It’s probably very simple. (code attached).