My application is working as a client application for a bank server. The application is sending a request and getting a response from the bank. This application is normally working fine, but sometimes

The I/O operation has been aborted because of either a thread exit or an application request

error with error code as 995 (0x3E3) comes through.

public void OnDataReceived(IAsyncResult asyn)
{
    BLCommonFunctions.WriteLogger(
        0,
        "In: OnDataReceived",
        ref swReceivedLogWriter, 
        strLogPath, 
        0);
    try
    {
        SocketPacket theSockId = (SocketPacket)asyn.AsyncState;

        int iRx = theSockId.thisSocket.EndReceive(asyn); // Here the error is coming
        string strHEX = BLCommonFunctions.ByteArrToHex(theSockId.dataBuffer);
    }
}

Once this error starts to come for all transactions after that same error begin to appear, so how can I sort out this problem?

If possible then with some sample code.

Edit
Report