Ethernet connection closes connection after some barcode scanner inputs

akshay123:
what is connect_error? can you send whole code ?

this code snippet is from my project and CONNECT_ERROR is my error code constant.
you can put a while(true); there and wait for watchdog restart or whatever