M
Mac Man
Hi
I am trying to establish communication between 2 applications.
On executing the below piece of code on client side application, I get
this error
socket_client.rb:3:in `initialize': Bad file descriptor - connect(2)
(Errno::EBADF) from socket_client.rb:3:in `new'
#########
code:
#########
require 'socket'
client_side = TCPSocket.new('localhost',1045)
puts "Enter some text: "
text=gets()
Server side code works fine and is implemented as displayed below.
require 'socket'
###########
code:
###########
server_side=TCPServer.new('localhost','1025')
port = server_side.accept
data = port.recvfrom(256)[0]
puts data
Any suggestions on what could be the possible problem?
PLease Help
Macman
I am trying to establish communication between 2 applications.
On executing the below piece of code on client side application, I get
this error
socket_client.rb:3:in `initialize': Bad file descriptor - connect(2)
(Errno::EBADF) from socket_client.rb:3:in `new'
#########
code:
#########
require 'socket'
client_side = TCPSocket.new('localhost',1045)
puts "Enter some text: "
text=gets()
Server side code works fine and is implemented as displayed below.
require 'socket'
###########
code:
###########
server_side=TCPServer.new('localhost','1025')
port = server_side.accept
data = port.recvfrom(256)[0]
puts data
Any suggestions on what could be the possible problem?
PLease Help
Macman