send connection to function