Topic: a question about TCPSockets - is this possible?


i am trying to make a database that i can use together with the animation software maya. maya has a feature where you can activate a "commandport", and maya will then listen to the port, and use the input as a command.

my idea was to make a site where the user could click a button, and server would send the mel command to the users "commandport" socket. i found a code example for ruby and sockets, but the problem is that the command gets send to the servers socket, and i would like it to get send to the clients instead.

my code so far looks like this:

def send_mel
# Ruby code
  require 'socket'
  maya ='localhost', 1181)
  # send a command
  results = maya.recv(4096)
  flash[:notice] = "maya output: ", results
  redirect_to :back

this creates a "sphere" on the server, but i would really like it send the command to the user instead, is this possible to do?

- mads

Re: a question about TCPSockets - is this possible?

What happens when you change

maya ='localhost', 1181)

maya ='some.other.server', 1181)

I suspect it may just be a firewalling issue on either end. The ruby server may not be allowed to make outbound connections to that port and/or the client isn't allowed to recieve on that port.