[sldev] [help] TCP and Sockets: connecting to SL with another
P.McEwan at sms.ed.ac.uk
Mon Aug 25 09:26:54 PDT 2008
After many searches through the Second Life viewer source code and the
list to no avail, I hope someone here would be able to guide me in the
right direction :).
I am attempting to have motion capture devices interface with SL to
movement of a user's agent through the players own movement. To do
this, I am planning to
use the "Puppeteering" version of the Viewer and, by manipulating the
joints, have the agent move with the player. In order to do this, I
need to communicate
with our group's program (MotionViewer or MV) which calculates the positions.
To communicate with the motion capture program, I planned to do the following:
- create a class which carries out the communication between SL and MV
- have the class create a TCP socket and connect to a socket server
run by MV on the
localhost (and a specific port)
- then, receive byte packets over the TCP connection from MV to SL
My attempts to do this so far have lead to dead-ends. Using a
"LLSocket" object, I have
been able to have SL connect to MV's server socket, but have no idea
how to then receive
packets (I had assumed using "LLSocketReader", but this does not seem
quite right). I
also tried using "net.h", but could not connect and feel this isn't
quite right either.
Searching through the source file seems to get me no further forward,
so I was wondering
if anyone knows a clean way I can do this? I had hoped there was some
for of library
Linden Labs used, as I really don't want to have to use "socket.h" and
have to worry
about platform and such.
Sorry for the long message, but any help you could give would be
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
More information about the SLDev