⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 socklist.cpp

📁 是一个ARM上面的PDA开发用的聊天工具,分为客户端与服务器端,纯LINUX环境编译,简单好用
💻 CPP
字号:
// socklist.cpp: implementation of the Csocklist class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "s.h"
#include "socklist.h"
#include "sockpoint.h"
#include "sock.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

Csocklist::Csocklist(CSDlg *pd)
{
	hand=new Csockpoint(pd);
	now=hand;
	end=hand;
}

Csocklist::~Csocklist()
{
	while(hand!=NULL)
	{
		now=hand->next;
		delete hand;
		hand=now;

	}
}

Csockpoint * Csocklist::addnew(CSDlg *pd)
{
	now=hand;
	while(1)
	{
		if(now->next==NULL)
		{
			now->next=new Csockpoint(pd);
			now=now->next;
			return now;
		}
		now=now->next;
	}
	/*
	end->next=new Csockpoint(pd);
	end=end->next;
	return end;
	*/
}

Csocklist::delone(Csock *ps)
{
	now=hand;
	while(now->next!=NULL)
	{
		if (now->next->psock==ps)
		{
			Csockpoint *temp;
			temp=now->next;
			now->next=now->next->next;
			temp->psock->Close();
			delete temp;	
			temp=NULL;
			break ;
		}
		now=now->next;
	}	
}

Csocklist::showall()
{
	now=hand->next;
	while(now!=NULL)
	{
		now->showall();
		now=now->next;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -