How can we do this?PLease we really need help.
That does not help/
Am 14.06.2013 19:55, schrieb Rs N.:
That does not help/
As the question, so the answer.
Or: be more specific, what have you tried, where did you get stuck, …?
require ‘socket’
s = TCPSocket.new ‘localhost’, 2000
while line = s.gets
puts line
end
s.close
thats the socket
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
That’s an example from the Socket
documentation. It should work.
And…?
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
It wont work
Still doesnt work:(
And it does! Read about connecting to localhost … Or ip from diff
computer firewall settings etc not just code here …
Sent from my iPhone
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.