H
HadsS
Hey...
Im new to this network programmin and I need help with this code i
copied and changed a little.
this is a client/server chat..
-----------------------
Server code:
require "socket"
PORT = 12321
server = TCPServer.new(PORT)
flag=true
while (session = server.accept)
while flag==true
print "Sending:"
line=gets.chomp!
session.puts line
end
end
----------------
Client Code:
require "socket"
PORT = 12321
HOST = ARGV[0] || "localhost"
flag=true
session = TCPSocket.new(HOST, PORT)
while flag==true
line = session.gets
puts "Recived:#{line} "
end
---------
i dont know what i did but its sort of doing a one way communication..
can someone please help me with creating two clients and making them
chat 2way amongst them..
please.. i would really be thankfulll
waiting for a reply
Im new to this network programmin and I need help with this code i
copied and changed a little.
this is a client/server chat..
-----------------------
Server code:
require "socket"
PORT = 12321
server = TCPServer.new(PORT)
flag=true
while (session = server.accept)
while flag==true
print "Sending:"
line=gets.chomp!
session.puts line
end
end
----------------
Client Code:
require "socket"
PORT = 12321
HOST = ARGV[0] || "localhost"
flag=true
session = TCPSocket.new(HOST, PORT)
while flag==true
line = session.gets
puts "Recived:#{line} "
end
---------
i dont know what i did but its sort of doing a one way communication..
can someone please help me with creating two clients and making them
chat 2way amongst them..
please.. i would really be thankfulll
waiting for a reply