more database socket stuff