How can we do this?PLease we really need help.
···
--
Posted via http://www.ruby-forum.com/.
How can we do this?PLease we really need help.
--
Posted via http://www.ruby-forum.com/.
http://lmgtfy.com/?q=ruby+socket
On Fri, Jun 14, 2013 at 10:48 AM, Rs N. <lists@ruby-forum.com> wrote:
How can we do this?PLease we really need help.
--
Posted via http://www.ruby-forum.com/\.
--
vizualize.me/cliffrosson
That does not help/
--
Posted via http://www.ruby-forum.com/.
require 'socket'
server = TCPServer.new 2000 # Server bind to port 2000
loop do
client = server.accept # Wait for a client to connect
client.puts "Hello !"
client.puts "Time is #{Time.now}"
client.close
end
--
Posted via http://www.ruby-forum.com/.
require 'socket'
s = TCPSocket.new 'localhost', 2000
while line = s.gets
puts line
end
s.close
Still doesnt work:(
--
Posted via http://www.ruby-forum.com/.
As the question, so the answer.
Or: be more specific, what have you tried, where did you get stuck, ...?
That's an example from the `Socket` documentation. It should work.
And...?
Am 14.06.2013 20:01, schrieb Rs N.:
require 'socket'
server = TCPServer.new 2000 # Server bind to port 2000
loop do
client = server.accept # Wait for a client to connect
client.puts "Hello !"
client.puts "Time is #{Time.now}"
client.close
end
How can we help you? Think about things you can provide us that might help
us figure out where you are getting stuck. Posting your code is a good
start. Help us help you. Right now people are reading your posts and seeing
them as a waste of time.
On Fri, Jun 14, 2013 at 11:16 AM, Rs N. <lists@ruby-forum.com> wrote:
Still doesnt work:(
--
Posted via http://www.ruby-forum.com/\.
--
vizualize.me/cliffrosson
And it does! Read about connecting to localhost ... Or ip from diff computer firewall settings etc not just code here ...
Sent from my iPhone
On Jun 14, 2013, at 1:07 PM, sto.mar@web.de wrote:
Am 14.06.2013 20:01, schrieb Rs N.:
require 'socket'
server = TCPServer.new 2000 # Server bind to port 2000
loop do
client = server.accept # Wait for a client to connect
client.puts "Hello !"
client.puts "Time is #{Time.now}"
client.close
endThat's an example from the `Socket` documentation. It should work.
And...?