Exemplo n.º 1
0
 def requestData(self, requestType, flag, startTime, endTime):
     if requestType == 0:  # 请求当天数据
         socketFun.requestCurrentDay(self, flag, startTime.time())
     elif requestType == 1:  # 请求某一天数据
         socketFun.requestOneDay(self, startTime.date(), startTime.time(), endTime.time())
     elif requestType == 2:  # 请求某一段时间数据
         socketFun.requestSomeTimes(self, startTime.date(), endTime.date())
     else:
         print "Request illegal Param"
Exemplo n.º 2
0
 def requestData(self, requestType, flag, startTime, endTime):
     if requestType == 0:  #请求当天数据
         socketFun.requestCurrentDay(self, flag, startTime.time())
     elif requestType == 1:  #请求某一天数据
         socketFun.requestOneDay(self, startTime.date(), startTime.time(),
                                 endTime.time())
     elif requestType == 2:  #请求某一段时间数据
         socketFun.requestSomeTimes(self, startTime.date(), endTime.date())
     else:
         print "Request illegal Param"
Exemplo n.º 3
0
	def requestData(self, requestType, flag, startTime, endTime):
		if requestType == 0:		#请求当天数据
			socketFun.requestCurrentDay(self, flag, startTime.time())
		elif requestType == 1:		#请求某一天数据
			socketFun.requestOneDay(self, startTime.date(), startTime.time(), endTime.time())
		elif requestType == 2:		#请求某一段时间数据
			socketFun.requestSomeTimes(self, startTime.date(), endTime.date())
		else:
			print "Request illegal Param"
			return
		thread.start_new_thread(socketFun.recvSubscibeRespond, (self,1)) 
Exemplo n.º 4
0
 def requestData(self, requestType, flag, startTime, endTime):
     if requestType == 0:  # 请求当天数据
         socketFun.requestCurrentDay(self, flag, startTime.time())
     elif requestType == 1:  # 请求某一天数据
         socketFun.requestOneDay(self, startTime.date(), startTime.time(), endTime.time())
     elif requestType == 2:  # 请求某一段时间数据
         socketFun.requestSomeTimes(self, startTime.date(), endTime.date())
     else:
         print "Request illegal Param"
         return
     thread.start_new_thread(socketFun.recvSubscibeRespond, (self, 1))
Exemplo n.º 5
0
def main():
	subStock = ["999999"]

	tcpCliSock = socket(AF_INET, SOCK_STREAM) 
	tcpCliSock.connect(ADDR)
	time.sleep(2)
	if tcpCliSock:
		#订阅股票
		socketFun.subscibeStock(tcpCliSock, subStock)
		print "1"
		#请求数据
		socketFun.requestCurrentDay(tcpCliSock, 0, datetime.time(12,01,00))
		print "2"
		#监听数据返回
		socketFun.recvSubscibeRespond(tcpCliSock)

	tcpCliSock.close()
	pass