user42569: I have question similar to old topic here Any way to pass EthernetClient to function outside of loop automatically?
I have in the main loop opening of the TCP server which is just maintaining the connection, but I need to send data from the interrupt rutine.
Can anybody tel me how to declare the connection globaly to be able to reference from event rutine and not from main loop only?
Thank you 

user359: You don't, instead you set a volatile flag in the interrupt routine and/or append to a circular buffer and handle the actual sending the next time through in your main loop.
The time delay from deferring action from the ISR to the main loop code will be on the order of milliseconds, if that.

42569: <p>I have question similar to old topic here <a href="https://arduino.stackexchange.com/questions/17357/any-way-to-pass-ethernetclient-to-function-outside-of-loop-automatically">Any way to pass EthernetClient to function outside of loop automatically?</a></p>

<p>I have in the main loop opening of the TCP server which is just maintaining the connection, but I need to send data from the interrupt rutine.</p>

<p>Can anybody tel me how to declare the connection globaly to be able to reference from event rutine and not from main loop only?</p>

<p>Thank you </p>
 359: <p>You don't, instead you set a volatile flag in the interrupt routine and/or append to a circular buffer and handle the actual sending the next time through in your main loop.</p>

<p>The time delay from deferring action from the ISR to the main loop code will be on the order of milliseconds, if that.</p>
