Beispiel #1
0
int epFUI_OnClose(struct ep_t *pep, struct ep_con_t *pnode)
{
	PrintConnectRemoveInf(pnode, PINF_FLAG_CLOSE);
	tms_RemoveDev(pnode->sockfd);
	tms_DelManage(pnode->sockfd);
	return 0;
}
Beispiel #2
0
int epFUI_OnAccept(struct ep_t *pep, struct ep_con_t *pnode)
{
	printf("----OnAccept----\n");
	ep_KeepAlive(pep,pnode,3,30,4,1);
	// ep_KeepAlive(pep,pnode,3,15,3,1);
	InitSocketStruct((struct tmsxx_app**)&pnode->ptr, pnode->sockfd);
	// ((struct tmsxx_app*)pnode->ptr)->fd = pnode->sockfd;
	// ((struct tmsxx_app*)pnode->ptr)->context.fd = pnode->sockfd;
	
	PrintConnectRemoveInf(pnode, PINF_FLAG_ACCEPT);
	// printf("%8d%16s:%-8d",
	// 	pnode->sockfd,
	// 	inet_ntoa(pnode->loc_addr.sin_addr),
	// 	htons(pnode->loc_addr.sin_port));
	// printf("%16s:%-8d\n",
	// 	inet_ntoa(pnode->rem_addr.sin_addr),
	// 	htons(pnode->rem_addr.sin_port));

	epapp_cb.pf_Accept(pnode->sockfd);
	// sleep(3);
	// tms_GetVersion(pnode->sockfd,  0, 0,DEV_OPM);
	// printf("send over\n");
	// sleep(3);

	return 0;
	
}
Beispiel #3
0
int epFUI_OnRemoveClose(struct ep_t *pep, struct ep_con_t *pnode)
{
	// tms_DelManage(pnode->sockfd);
	// tms_DelManage(&(((struct tmsxx_app*)(pnode->ptr))->context),
	// pnode->sockfd);
	printf("----OnRemoveClose----\n");
	// printf("close addr %8.8x\n",pnode->ptr);
	FreeSocketStruct((struct tmsxx_app **)&pnode->ptr);

	PrintConnectRemoveInf(pnode, PINF_FLAG_REMOVE);

	// printf("%8d%16s:%-8d",
	// 	pnode->sockfd,
	// 	inet_ntoa(pnode->loc_addr.sin_addr),
	// 	htons(pnode->loc_addr.sin_port));
	// printf("%16s:%-8d\n",
	// 	inet_ntoa(pnode->rem_addr.sin_addr),
	// 	htons(pnode->rem_addr.sin_port));

	// tms_RemoveDev(pnode->sockfd);


	epapp_cb.pf_RemoteClose(pnode->sockfd);
	// tms_DelManage(pnode->sockfd);
	return 0;

}
Beispiel #4
0
int epFUI_OnClose(struct ep_t *pep, struct ep_con_t *pnode)
{
	// tms_DelManage(pnode->sockfd);
	// tms_DelManage(&(((struct tmsxx_app*)(pnode->ptr))->context),
	// pnode->sockfd);
	PrintConnectRemoveInf(pnode, PINF_FLAG_CLOSE);
	// tms_RemoveDev(pnode->sockfd);

	return 0;
}
Beispiel #5
0
int epFUI_OnConnect(struct ep_t *pep, struct ep_con_t *pnode)
{
	printf("----OnConnect----\n");
	// printf("start\n")	;
	InitSocketStruct((struct tmsxx_app**)&pnode->ptr, pnode->sockfd);
	// ((struct tmsxx_app*)pnode->ptr)->fd = pnode->sockfd;
	((struct tmsxx_app*)pnode->ptr)->context.fd = pnode->sockfd;
	// printf("connect struct ok");
	PrintConnectRemoveInf(pnode, PINF_FLAG_CONNECT);

	return 0;

	
}