PDA

View Full Version : IP Transport slow to receive client connection?



rickd
April 29th, 2012, 10:11 PM
function iruleTCPserver(p1,p2)
if ( p2 == transport.constants.event.CONNECTIONCLOSED ) then
print("#1 response PROBABLY WILL NOT HAPPEN...")
return
end
if ( p2 == transport.constants.event.NEWCONNECTION ) then
print("New iRule Connection.")
iruleTCPclients[p1]=true
gir.TriggerEvent("irule_send", 100, 0)

p1:Callback(transport.constants.parser.TERMINATED, '\n', 1000, function (cp1,cp2)
if cp1 then
gir.TriggerEvent(string.trim(cp1), 100, 0) --was 100
print (cp1)
end
if ( cp2 == transport.constants.event.CONNECTIONCLOSED ) then
print("#2 response PROBABLY WILL NOT HAPPEN...")
p1:Close()
iruleTCPclients[p1]=nil
return

end

end)
return
end

end
if ( iruleTCPclients ) then
for c,v in pairs(iruleTCPclients ) do
c:Close()
end
end
if ( irulec5 ) then
irulec5:Close()
end
iruleTCPclients = {}
iruleLISTENER = transport.New(transport.constants.transport.GIPLIS TEN)
if not iruleLISTENER:Open(nil, 9999) then
print("Could not create iRule TCP server.")
iruleLISTENER:Close();
iruleLISTENER = nil;
end
iruleLISTENER:Callback(transport.constants.parser. TERMINATED, '\r\n', 2000, iruleTCPserver)
print("Starting iRule TCP Server...")

I have two instances of girder running this and accepting client connections to send events problem is it is slow to accept connection not sure why. It is taking two to three attempts for the iRule client to get a connection.

Any ideas to trouble shoot and determine how I can see what is the cause. Once connected it works ok but also getting delays on occassion or a backlog of events.

Thanks

shaun5
May 1st, 2012, 01:46 PM
Are you sure iRule is sending the \r\n terminator?

rickd
May 2nd, 2012, 08:58 PM
yes it was a network issue in my router solved thanks