We make the following lemma:
Lemma. Suppose $f(z)$ is holomorphic near $z = z_0$. Fix $\theta_0 \in (0, 2\pi)$. If $\gamma_{\epsilon}$ denotes a counter-clockwise oriented arc of angle $\theta_0$ on the circle of radius $\epsilon$ centered at $z_0$, then $ \lim_{\epsilon\to0} \int_{\gamma_{\epsilon}} \frac{f(\zeta)}{\zeta-z_0}\;d\zeta=i\theta_0 f(z_0).$
Proof. By the substitution $\zeta = z_0 + \epsilon e^{i\theta}$, we have $\begin{align*} \left| \int_{\gamma_{\epsilon}} \frac{f(\zeta)}{\zeta-z_0}\;d\zeta - i\theta_0 f(z_0)\right| &= \left| i \int_{\theta_1}^{\theta_1+\theta_0} f(z_0 + \epsilon e^{i\theta})\;d\theta - i\theta_0 f(z_0)\right| \\ & \leq \int_{\theta_1}^{\theta_1+\theta_0} \left| f(z_0 + \epsilon e^{i\theta}) - f(z_0) \right| \;d\theta, \end{align*}$ which clearly goes to zero when $\epsilon \to 0$.
As a corollary, if $f(z)$ has a simple pole at $z = z_0$ then with the same notation as in the Lemma, we have
$ \lim_{\epsilon\to0} \int_{\gamma_{\epsilon}} f(\zeta) \;d\zeta=i\theta_0 \mathrm{Res} \{ f(z), z_0 \}.$
Now let $C$ be the upper-semicircular contour of radius $R \gg 1$ with a small semicircular indent of radius $\epsilon \ll 1$ at the origin. Let us write $C$ as $ C = \Gamma_{R} + L_{\epsilon,R} - \gamma_{\epsilon},$ where $\Gamma_R$ and $\gamma_{\epsilon}$ denote counter-clockwise oriented arcs corresponding to the outer circle and the inner circle of $C$, respectively, and $L_{\epsilon,R}$ denote the remaining union of two lines on $C \cap \Bbb{R}$. Now for
$ f(z) = \frac{e^{2\pi i z}}{z(z^2 + 3)}, $
the integral in question, which we denote as $I$, is equal to
$I = \frac{1}{2i} \lim_{{\epsilon \to 0 \atop R \to \infty}} \int_{L_{\epsilon, R}} f(z) \; dz.$
Now, by Cauchy integration formula,
$ \oint_{C} f(z) \; dz = 2\pi i \mathrm{Res} \{ f(z), i\sqrt{3} \}. $
This means that
$ \int_{L_{\epsilon, R}} f(z) \; dz = 2\pi i \mathrm{Res} \{ f(z), i\sqrt{3} \} + \int_{\gamma_{\epsilon}} f(z) \; dz - \int_{\Gamma_R} f(z) \; dz. $
Taking limit $\epsilon \to 0$ and $R \to \infty$, the integral $\int_{\Gamma_R} f(z) \; dz$ vanishes by Jordan's lemma. Thus by our lemma,
$ \lim_{{\epsilon \to 0 \atop R \to \infty}} \int_{L_{\epsilon, R}} f(z) \; dz = 2\pi i \mathrm{Res} \{ f(z), i\sqrt{3} \} + \pi i \mathrm{Res} \{ f(z), 0 \}.$
But since
$ \mathrm{Res} \{ f(z), i\sqrt{3} \} = \left. (z-i\sqrt{3})f(z) \right|_{z=i\sqrt{3}} = -\frac{1}{6}e^{-2\pi \sqrt{3}} $
and
$ \mathrm{Res} \{ f(z), 0 \} = \left. z f(z) \right|_{z=0} = \frac{1}{3}, $
we have
$ I = \frac{1}{2i} \left[ 2\pi i \left(-\frac{1}{6}e^{-2\pi \sqrt{3}}\right) + \pi i \left(\frac{1}{3} \right) \right] = \frac{\pi}{6}\left(1 - e^{-2\pi \sqrt{3}} \right). $