07 Mar, 2008, exeter wrote in the 1st comment:
Votes: 0
I've been struggling with TeensyMUD for a little bit now, and I can't seem to resolve this error:

~/tmud-2.10.0$ uname -a
Linux ubuntu 2.6.22-14-generic #1 SMP Tue Feb 12 07:42:25 UTC 2008 i686 GNU/Linux

~/tmud-2.10.0$ ruby tmud.rb
08-03-06 23:09:51 [ INFO] (YamlStore) Loading world…
08-03-06 23:09:51 [ INFO] (YamlStore) Database 'db/world.yaml' loaded…highest id = 1.
08-03-06 23:09:51 [ INFO] (Command) Loading commands…
08-03-06 23:09:51 [ INFO] (Command) Done.
08-03-06 23:09:51 [ INFO] (World) Starting Timer…
08-03-06 23:09:51 [ INFO] (World) World initialized.
08-03-06 23:09:51 [ INFO] (EventManager) Event manager starting…
08-03-06 23:09:51 [ INFO] (Engine) Booting server on port 4747
08-03-06 23:09:51 [FATAL] (Acceptor) Caught Errno::EINVAL: Invalid argument
./lib/network/acceptor.rb:39:in `setsockopt'
./lib/network/acceptor.rb:39:in `init'
./lib/network/reactor.rb:83:in `start'
./lib/engine/engine.rb:98:in `run'
tmud.rb:87
08-03-06 23:09:51 [FATAL] (Engine) Engine failed in run
08-03-06 23:09:51 [FATAL] (Engine) Caught RuntimeError: Unable to start server
./lib/engine/engine.rb:98:in `run'
tmud.rb:87

Unfortunately, I don't really know enough about ruby (or TeensyMUD) as yet to figure out what's wrong. Can anyone help? This is a standard Ubuntu 7.10 install.

Thanks!
07 Mar, 2008, David Haley wrote in the 2nd comment:
Votes: 0
It looks like it's failing on line 39 of acceptor.rb, on the call to setsockopt.

Not knowing TeensyMUD at all, all I can point you to is the man page for "setsockopt" – the errno you're getting, EINVAL, claims that an invalid length was passed into the setsockopt call. I guess you'd have to look at the call to setsockopt and see if it makes sense.
07 Mar, 2008, Itansha wrote in the 3rd comment:
Votes: 0
I'm not familiar with TeensyMUD, but trying to run a freshly unzipped version on my computer (os x leopard) generates the same error. I did some snooping, and the error in question is caused by trying to set the SO_LINGER socket option with a boolean rather than the linger struct as defined in my system's socket.h. Try replacing the following line (acceptor.rb line 39)
@sock.setsockopt(Socket::SOL_SOCKET, Socket::SO_LINGER, false)

with
@sock.setsockopt(Socket::SOL_SOCKET, Socket::SO_LINGER, [0,0].pack('ii'))


Doing that fixed it on my system. In case you wish to change the linger settings, [0,0] corresponds to

struct	linger {
int l_onoff; /* option on/off */
int l_linger; /* linger time */
};


Let me know if that works for you. :-)
10 Mar, 2008, exeter wrote in the 4th comment:
Votes: 0
That did indeed fix it! Thanks.
0.0/4