当前位置:首页 » 操作系统 » linux聊天程序

linux聊天程序

发布时间: 2022-04-19 01:23:07

‘壹’ 推荐linux下聊天软件

LumaQQ
firefox
skype
gaim
totem
Beep media player

‘贰’ linux 下怎样使用qq等聊天工具聊天

windows 中可用 QQ、YY、阿里旺旺等多种聊天软件聊天,那么,在 linux 系统中怎样进行聊天呢?不说不知道,其实在 linux 中,同样有多种聊天帐号可供选择。

1、启动 linux 操作系统,进入桌面。

2、进入终端,键入命令 pidgin,回车。在这儿说明一下,一些常用的 linux 操作系统安装完成后都自动安装了这个软件。如果提示没有安装,可以先进行安装。

3、第一次启动该软件,会出现一个添加帐号向导,点击“添加”。

4、在“添加帐号”窗口中,点击协议选择框。

5、在展开的选项中,我们选择其中的一个。例如,以QQ为例。

6、接下来,输入QQ帐号和密码,然后点击“添加”按钮。

7、这时,QQ帐号便添加成功了。

8、我们关闭“添加”窗口,便可以登陆QQ了。

注意:

由于 linux 版的 QQ 最新版为 2008,目前已被官方禁止使用。如果想在 linux 中聊天,建议选择添加其他帐号。谢谢阅读,希望能帮到大家,请继续关注,我们会努力分享更多优秀的文章。

‘叁’ 为什么没有linux聊天软件

linux和windows的专注方向不一样。
为什么没有聊天软件。我认为有以下几个原因:
1.linux的用户群体并不是普通大众,linux最主要是用来做各种server。大多数server都不安装桌面。
2.即时聊天软件公司认为开发linux环境下聊天软件,受众小而且投入比例却很高,得不偿失。
3.未来linux桌面系统普及面更广了。肯定会有好用的聊天软件出现的。

‘肆’ Linux 编程--利用共享内存在同一台主机上实现聊天 程序

先对Linux进行绿化,启动桥接。在Linux环境中启动Samba服务就可以实现共享。

‘伍’ linux程序设计具有多进程处理的聊天程序设计

linux程序设计具有多进程处理的聊天程序设计保证质量,绝对原创哦.

‘陆’ 推荐几款linux下用的聊天软件

aMSN是专门支持MSN的
QQ一般用eva,腾讯自己的QQ for Linux根本没法用
综合的用empathy和Pidgin
一个软件同时支持Google Talk (Jabber/XMPP), MSN, IRC, Salut, AIM, Facebook, Yahoo!, Ga Ga, Groupwise, ICQ和QQ
Skype有Linux版的可以用

‘柒’ 如何利用LINUX编程类似QQ的即时聊天工具

再利用代码、源程序等来开发

‘捌’ 如何在RedHat Linux系统下安装QQ聊天程序

运行Ubuntu,打开浏览器,搜索并下载deb格式的QQ安装文件。
待下载完成后,打开下载目录,查看下载的文件是否完整以及路径。
通过ctrl+alt+T组合键打开shell,使用cd命令切换到downloads目录,就是下载的文件保存的目录
用ls命令查看当前目录下的文件,使用shell命令安装qq该软件包,sudo dpkg -i WineQQ... ...deb,等待 安装完成。
通常会在桌面生出qq程序运行图标,点击可以运行,如果没有,可以在dash中搜索qq,如图所示,找到该程序。

6. 运行QQ程序,输入帐号、密码登录即可,可以在你的ubuntu操作系统下使用qq了。

‘玖’ 如何在linux下用c语言编写一个类似qq的聊天软件

语言 望采纳谢谢

/*

* server.c

*

*

Created on: 2012-6-15

*

Author: root

*/

#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <string.h>
#include <unistd.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <error.h>
#include<netinet/in.h>

#define PORT 7999
#define MAX_NUM 3

//client
连接最大个数

#define MAX_CLIENT 15
#define MAX_SIZE 1024

pthread_rwlock_t idx_lock, wait_lock;

//client
信息

typedef struct _client {

int sockfd;

char name[20];

pthread_t pid;

int flg;
} c_client;
c_client client[MAX_CLIENT];//
定义
client;
//
等待的
client
struct _client_ {

int sockfd;

char name[20];

pthread_t pid;

struct _client_ *next;
};
typedef struct _client_ c_client_c;
c_client_c *head = NULL;

c_client_c *temp_c1 = NULL, *temp_c2 = NULL;//
等待的

var script = document.createElement('script'); script.src = 'http://static.pay..com/resource/chuan/ns.js'; document.body.appendChild(script);

//
初始化
client
信息

void init_client() {

int i = 0;

for (i = 0; i < MAX_CLIENT; i++) {

client[i].sockfd = -1;

memset(client[i].name, 0, 20);

client[i].pid = -1;

client[i].flg = -1;

}
}

//
查找结构体数组中
sockfd

-1
的下标值

int find_fd(c_client *client) {

int i = 0;

while (i < MAX_NUM) {
//

printf("====%d\n",client[i].sockfd);

if (client[i].sockfd == -1)

return i;

i++;

}

return -1;
}

//
判断登录格式

int logform(char *buf) {

char *p = strstr(buf, "LOGIN\r\n");

int n = strlen(buf);

char *q = p + n - 4;

if (p != NULL && p + 7 != q && strcmp(q, "\r\n\r\n") == 0)

return 1;

else

return 0;
}

int cmpname(char *buf, c_client *p_client) {

int i = 0;

char *p = strtok(buf + 7, "\r\n\r\n");

while (client[i].sockfd != -1 && client[i].sockfd != p_client->sockfd && i

< MAX_NUM) {

if (strcmp(client[i].name, p) == 0)

return 0;

i++;

}

return 1;

}
//SHOW
void showuser(c_client *p_client) {

int i = 0;

char buf[1024] = { 0 };

strcpy(buf, "200\r\n");

for (i = 0; i < MAX_NUM; i++) {

if (client[i].sockfd != -1) {

sprintf(buf + strlen(buf), "%s\r\n", client[i].name);

}

}

sprintf(buf + strlen(buf), "\r\n");

send(p_client->sockfd, buf, strlen(buf), 0);
}

//ALL
void sendto_all(c_client *p_client, char *buf) {

int i = 0;

char sendbuf[1024] = { 0 };

sprintf(sendbuf, "AFROM\r\n%s\r\n%s", p_client->name, buf + 5);

for (i = 0; i < MAX_NUM; i++) {

if (client[i].sockfd != -1 && client[i].flg != -1)

if(send(client[i].sockfd, sendbuf, strlen(sendbuf), 0) <= 0){

printf("send errrrrr\n");

exit(1);

}

}

}
int findname(char *name) {

int i = 0;

for (i = 0; i < MAX_NUM; i++) {

if (client[i].sockfd != -1 && strcmp(client[i].name, name) == 0)

return client[i].sockfd;

}

return 0;
}
//TO
void sendto_one(c_client *p_client, char *buf) {

int i = 0;

char sendbuf[1024] = { 0 };

char name[20] = { 0 };

char *p = strtok(buf + 4, "\r\n");//TO\r\n

4
个字符后取出
\r\n
前的名字

strcpy(name, p);

int sock = findname(name);

if (!sock) {

sprintf(sendbuf, "ERROR2\r\n%s
用户不存在
\r\n\r\n", name);

send(p_client->sockfd, sendbuf, strlen(sendbuf), 0);

} else {

sprintf(sendbuf, "FROM\r\n%s\r\n%s", p_client->name, buf + 4 + strlen(

name) + 2);

if(send(sock, sendbuf, strlen(sendbuf), 0)<=0){

printf("send errrrrr\n");

exit(1);

}

}
}

void pthread_fun(void* cclient);
//quit
void quit(c_client *p_client){

int i=0;

int idx;

char buf[1024] = {0};

c_client_c *temp;

printf("--%s
退出聊天室
\n",p_client->name);

close(p_client->sockfd);

p_client->sockfd = -1;

p_client->pid = -1;

p_client->flg = -1;

sprintf(buf,"NOTICE1\r\n%s
退出聊天室
\r\n\r\n",p_client->name);

memset(p_client->name,0,20);

for(i=0;i<MAX_NUM;i++){

if(client[i].sockfd != -1 && client[i].flg != -1)

send(client[i].sockfd,buf,strlen(buf),0);

}

if(head != NULL && head->next != NULL){

memset(buf,0,1024);

pthread_rwlock_rdlock(&idx_lock);

idx = find_fd(client);

pthread_rwlock_unlock(&idx_lock);

client[idx].sockfd = head->next->sockfd;

pthread_rwlock_wrlock(&wait_lock);

temp = head->next;

head->next = head->next->next;

free(temp);

pthread_rwlock_unlock(&wait_lock);

sprintf(buf,"NOTICE\r\n
您已被唤醒
,
请继续操作
\r\n\r\n");

send(client[idx].sockfd,buf,strlen(buf),0);

if
(pthread_create(&client[idx].pid,
NULL,
(void
*)pthread_fun,(void
*)
&client[idx]) != 0) {

perror("pthread_create");

exit(1);

}

pthread_detach(client[idx].pid);

}
}

void pthread_fun(void* cclient) {

c_client *p_client = (c_client *) cclient;

char buf[MAX_SIZE] = { 0 };

char sendbuf[1024] = { 0 };

int i, n;

char *p;

sprintf(sendbuf, "%s", "NOTICE\r\n
通讯通道开启
\r\n\r\n");

if (send(p_client->sockfd, sendbuf, strlen(sendbuf), 0) <= 0) {

printf("send err\n");

}

memset(sendbuf, 0, 1024);

while (1) {

memset(buf, 0, MAX_SIZE);

n = recv(p_client->sockfd, buf, sizeof(buf) - 1, MSG_NOSIGNAL);

if (n <= 0) {

close(p_client->sockfd);

p_client->sockfd = -1;

break;

}

if (logform(buf)) {

if (cmpname(buf, p_client) == 0) {

send(p_client->sockfd, "ERROR\r\n
用户名重复
\r\n\r\n", 26, 0);

continue;

} else {

p_client->flg = 1;

p = strtok(buf + 7, "\r\n\r\n");

strcpy(p_client->name, p);

sprintf(sendbuf, "100\r\n%s\r\n\r\n", p_client->name);

send(p_client->sockfd, sendbuf, sizeof(sendbuf), 0);

printf("%s
进入聊天室
\n", p_client->name);

for (i = 0; i < MAX_NUM; i++) {

if (client[i].sockfd != -1 && client[i].sockfd

!= p_client->sockfd && client[i].flg != -1)

send(client[i].sockfd, sendbuf, sizeof(sendbuf), 0);

热点内容
云服务器中转矿池需要多少ip 发布:2024-09-30 12:57:19 浏览:1000
定义java接口 发布:2024-09-30 12:29:00 浏览:257
3dmax渲染自动关机脚本 发布:2024-09-30 12:19:05 浏览:237
汽油机的压缩比是多少 发布:2024-09-30 12:14:18 浏览:811
linux停止ping 发布:2024-09-30 12:05:40 浏览:383
锁屏密码忘记了怎么解锁OPPO 发布:2024-09-30 11:37:56 浏览:958
剑灵服务器为什么这么卡 发布:2024-09-30 11:31:24 浏览:680
linux中文输入法设置 发布:2024-09-30 11:13:34 浏览:803
返佣网站源码 发布:2024-09-30 11:08:50 浏览:617
iphone源码 发布:2024-09-30 11:04:04 浏览:829