function P2SCheck(tab)
	local hubHelper = XLGetObject("Xunlei.HubHelper.Obj")
	local hostHelper = XLGetObject("Xunlei.HostHelper.Obj")

	local sdn, tmp = hubHelper:GetShubDN()
	local pdn, tmp = hubHelper:GetPhubDN()
	local sip = hostHelper:GetHostByName(sdn)
	local pip = hostHelper:GetHostByName(pdn)
	if sip==nil or pip==nil then
		return 6
	end
	
	local suc, sid = hubHelper:GetShubConnectState(sip)
	local suc, pid = hubHelper:GetPhubConnectState(pip)
	
	local osShell = XLGetObject("Xunlei.OSShell.Obj")
	local bSSuc = 0
	local bPSuc = 0
	local bSCon = 0
	local bPCon = 0
	for i=1,12 do
		osShell:Sleep(1000)
		if bSSuc==0 then
			bSSuc, bSCon = hubHelper:GetShubConnectStateResult(sid)
		end
		if bPSuc==0 then
			bPSuc, bPCon = hubHelper:GetPhubConnectStateResult(pid)
		end
		
		if bSSuc~=0 and bPSuc~=0 then
			break
		end
	end
	
	local result = 0
	if bSCon==0 then
		result = result + 4
	end
	
	if bPCon==0 then
		result = result + 2
	end

	return result
end
