A communicating hydrocele occurs while the baby is in the womb. A membrane extends through the inguinal canal in the abdominal wall into the scrotum. The thin membrane is called the processus vaginalis. If it remains open, fluid flows back and forth from the abdominal cavity and the scrotum.
A non-communicating hydrocele in a boy or adult male can be caused by an injury to the scrotum.