Great thanks that works well just need a little more help.
How do i make it so that I can send data from girder that I want rather than just echo the data sent from irule or terminal as both work.
I need a way to add pushing my data out to the irule client or terminal ..I know that it can just not sure how to do that. Can you provide example?
Code:
function mycbserver(p1,p2)
if ( p2 == transport.constants.event.CONNECTIONCLOSED ) then
print("Connection Closed")
return
end
if ( p2 == transport.constants.event.NEWCONNECTION ) then
print("New Incoming Connection")
p1:Callback(transport.constants.parser.TERMINATED,'\n', 3000, function (cp1,cp2)
if ( cp2 == transport.constants.event.CONNECTIONCLOSED ) then
print("Client Connection Closed")
table.print(clients[p1])
p1:Close()
clients[p1]=nil
return
end
if ( cp2 == transport.constants.event.CONNECTIONESTABLISHED ) then
if ( cp1 == 0 ) then
print("New Client Connection")
p1:Write("welcome to our echo telnet server!\r\n")
clients[p1]=true
else
print("New Client Connection Failed: ")
p1:Close()
clients[p1]=nil
end
return
end
print(cp1)
p1:Write(cp1 .. '\r\n')
end)
return
end
end
if ( clients ) then
for c,v in pairs(clients ) do
c:Close()
end
end
if ( c5 ) then
c5:Close()
end
clients = {}
c5 = transport.New(transport.constants.transport.GIPLISTEN)
if not c5:Open(nil, 12345) then
print('Could not start listening')
c5:Close();
c5 = nil;
end
c5:Callback(transport.constants.parser.TERMINATED, '\r\n', 1000, mycbserver)
print('Listening for connections on port 12345, use telnet localhost 12345 from the commandline')
thanks Rick