{
socket.Connect(RemoteEndPoint);
}
- catch (SocketException e)
+ catch (Exception e)
{
- throw new HazelException("Could not connect as a socket exception occured.", e);
+ throw new HazelException("Could not connect as an exception occured.", e);
}
//Start receiving data
{
StartWaitingForHeader(BodyReadCallback);
}
- catch (SocketException e) //TODO change these to catch exception, security risk
+ catch (Exception e)
{
- throw new HazelException("A Socket exception occured while initiating the first receive operation.", e);
+ throw new HazelException("An exception occured while initiating the first receive operation.", e);
}
//Send handshake
{
socket.BeginSend(fullBytes, 0, fullBytes.Length, SocketFlags.None, null, null);
}
- catch (SocketException e)
+ catch (Exception e)
{
- HazelException he = new HazelException("Could not send data as a SocketException occured.", e);
+ HazelException he = new HazelException("Could not send data as an occured.", e);
HandleDisconnect(he);
throw he;
}
{
StartWaitingForBytes(length, callback);
}
- catch (SocketException e)
+ catch (Exception e)
{
- HandleDisconnect(new HazelException("A Socket exception occured while initiating a body receive operation.", e));
+ HandleDisconnect(new HazelException("An exception occured while initiating a body receive operation.", e));
}
}
{
StartWaitingForHeader(BodyReadCallback);
}
- catch (SocketException e)
+ catch (Exception e)
{
- HandleDisconnect(new HazelException("A Socket exception occured while initiating a header receive operation.", e));
+ HandleDisconnect(new HazelException("An exception occured while initiating a header receive operation.", e));
}
Statistics.LogReceive(bytes.Length, bytes.Length + 4);
{
StartWaitingForHeader(BodyReadCallback);
}
- catch (SocketException e)
+ catch (Exception e)
{
- HandleDisconnect(new HazelException("A Socket exception occured while initiating the first receive operation.", e));
+ HandleDisconnect(new HazelException("An exception occured while initiating the first receive operation.", e));
}
}
}
);
}
- catch (SocketException e)
+ catch (Exception e)
{
- HandleDisconnect(new HazelException("A Socket exception occured while initiating the first receive operation.", e));
+ HandleDisconnect(new HazelException("An exception occured while initiating the first receive operation.", e));
}
}
//If the socket's been disposed then we can just end there.
return;
}
- catch (SocketException e)
+ catch (Exception e)
{
- HandleDisconnect(new HazelException("A Socket exception occured while completing a chunk read operation.", e));
+ HandleDisconnect(new HazelException("An exception occured while completing a chunk read operation.", e));
return;
}
{
StartWaitingForChunk(state);
}
- catch (SocketException e)
+ catch (Exception e)
{
- HandleDisconnect(new HazelException("A Socket exception occured while initiating a chunk receive operation.", e));
+ HandleDisconnect(new HazelException("An exception occured while initiating a chunk receive operation.", e));
return;
}
}