In the Protagoras, Socrates suggests that one seeks the maximum amount of benefit with the minimum amount of harm, and that no one willingly seeks harm. In addition, when faced with the choice of two harms, Socrates argues that no one would choose the greater harm when he could choose the lesser.
In the Apology, Socrates claims that, if you kill him, you will injure yourself more than you will injure him. Socrates believed that nothing would injure him, for a bad man is not permitted to injure anyone better than himself. Socrates did not deny that someone could kill him, but he believed that the greater harm would to the killer for unjustly taking a man's life. According to Socrates, one who unjustly kills is harmed more than the person who is unjustly killed. According to Socratic doctrine, harm is something that fails to maximize one's happiness over a lifetime and that, until one’s life ends, one cannot judge whether something that occurred during the lifetime was good or harmful.
Socrates argues that knowledge and virtue are so closely related that no person ever knowingly does evil, that all people invariably do what they believe to be best. Therefore, improper conduct can only be a result of our ignorance rather than a symptom of weakness of the will.
For Socrates, harm, to oneself or another, consists of failure to maximize happiness over a lifetime, given the circumstances. Thus, if we are to determine whether something is harmful, we must compare all the possible options on our bodies and psyches to determine which actions fail to maximize happiness.
Since Socrates thinks there is no difference between doing an injustice to a person and harming the person, how would Socrates thoughts relate to self-defense? If you harm an attacker while physically defending yourself, is it an injustice, and do you harm an attacker by physically defending yourself?