Socket / net question

It’s been a while, and here I am with another question (:

In the often aforementioned BBS program that I am still mucking about with,
I am using sockets to make a telnet server.

This works great. What doesn’t work great, is if you try to use net/ftp
while a socket is open. If a socket is open, it fails, every time. If no
sockets are open, (connected, whatever…) then it always works…

I’ve been living with this, because I haven’t written the bit that kicks it
off automatically yet. I would like it to be able to run while users are
connected, if possible.

Ideas? I’m stumped… (lack of knowledge again…)

Thanks!

Mark

NOTICE: This e-mail and any attachment(s) may contain confidential and
proprietary information of Goss International Corporation and/or its
subsidiaries and may be legally privileged. This e-mail is intended solely
for the addressee. If you are not the addressee, dissemination, copying or
other use of this e-mail or any of its content is strictly prohibited and
may be unlawful. If you are not the intended recipient please inform the
sender immediately and destroy the e-mail and any copies. All liability for
viruses is excluded to the fullest extent permitted by law. Any views
expressed in this message are those of the individual sender. No contract
may be construed by this e-mail.

Since you let the socket Genie out of the bottle: Where can I find
the ruby source for TCPServer and Socket? I can’t find either anywhere
and I built from source.

Also, why must one call `gets’ on one’s TCPserver object before
calling print? This makes no sense to me.

Let me show an example of what I’m refering to.

server = TCPServer.new(“0.0.0.0”,“8888”)
session = server.accept
while(out = session.gets) ## <–if I don’t call gets' on session puts out ## I can't callsession.print’ below
end

···

##if you call gets' above then the following lines will execute ##if you don't call gets above, thensession.print’ fails --why?

session.print "HTTP:/1.1 200 OK/OK\r\nContent-type: text/html\r\n\r\n"
session.print “

#{Time.now}

\r\n”