Ethernet connection closes connection after some barcode scanner inputs

what is connect_error? can you send whole code ?