FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    Simulated QQ chat room (thread concurrent)

     

    “#包括 #包括 #包括 #包括 #包括 #包括 #包括 #包括 #包括 #包括 #定义LISTENQ 1000//最大连接数 #定义MAXLINE 512//发送消息的最长字节 #定义maxme1000 #定义名称20//名字长度 结构socketcfd { 字符名[20]; int-fd; }; int-listenfd; //分别记录服务器端的套接字与连接的多个客户端的套接字 结构socketcfd connfd[MAXMEM]; 无效rcv_snd(无效*参数) //服务器接受并转发消息函数 { char*ask=“”请输入你的名字:""; char*ask1=“”使用说明:\n1、n1群聊可以直接发送消息,\n2、私聊请先输入@+人名+空格+内容,\n3、退出直接输入“再见“\n------------------------------------------”; char*ch=“”此用户不存在""; char*ch1=“”群聊""; char*ch2=“”私聊""; 字符buff[MAXLINE]; //用户姓名 char buff1[MAXLINE]; //聊天内容(包括私聊和群聊,然后对它进行分析) char buff2[MAXLINE]; //发送消息的时间 char buff3[MAXLINE]; //私聊时接受用户的姓名 char buff4[MAXLINE]; //私聊时发送的内容 时间滴答; int i=0; 内部检索; 内伦; int k=0,j=0,m=0; INTP; int n=(int*)arg; //获取此进程对应的套接字用户的名字 写(connfd[n].fd,ask,strlen(ask)); len=read(connfd[n].fd,connfd[n].name,NAMELEN); 如果(len>0){ connfd[n].名称[len]=0; } printf(“”用户姓名:%s\n“”,connfd[n].名称); //把当前用户的加入告知所有用户 strcpy(buff,connfd[n].name); strcat(buff,“\t加入聊天""); 对于(i=0;i0) { buff1[len]=0; //当前用户的输入信息为“再见“时,当前用户退出 如果(strcmp(“再见”,buff1)=0){ printf(“%s”)用户已退出\n“”,connfd[n].名称); 关闭(connfd[n].fd); connfd[n].fd=-1; pthread_退出(&retval); } //通过分析发送的信息判断是群聊还是私聊 如果(buff1[0]='@'){ j=0;m=0; 对于(k=1;kp){ buff4[m]=buff1[i]; m++; } 否则如果(iMAXMEM){ 写入(connfd[n].fd,ch,strlen(ch)); } } }否则{ 刻度=时间(空); sprintf(buff2,“%.24s\r\n”,ctime(&ticks)); strcpy(buff,buff2); strcat(浅黄色,ch1); strcat(buff,“\t”); strcat(buff,connfd[n].名称); strcat(buff,“\n”); strcat(buff,buff1); 对于(i=0;i

     

     

     

     

    List all Question

    Nickname

    Email

    Questions

    Our other product:

    Professional FM Radio Station Equipment Package

     



     

    Hotel IPTV Solution

     


      Enter email  to get a surprise

      fmuser.org

      es.fmuser.org
      it.fmuser.org
      fr.fmuser.org
      de.fmuser.org
      af.fmuser.org ->Afrikaans
      sq.fmuser.org ->Albanian
      ar.fmuser.org ->Arabic
      hy.fmuser.org ->Armenian
      az.fmuser.org ->Azerbaijani
      eu.fmuser.org ->Basque
      be.fmuser.org ->Belarusian
      bg.fmuser.org ->Bulgarian
      ca.fmuser.org ->Catalan
      zh-CN.fmuser.org ->Chinese (Simplified)
      zh-TW.fmuser.org ->Chinese (Traditional)
      hr.fmuser.org ->Croatian
      cs.fmuser.org ->Czech
      da.fmuser.org ->Danish
      nl.fmuser.org ->Dutch
      et.fmuser.org ->Estonian
      tl.fmuser.org ->Filipino
      fi.fmuser.org ->Finnish
      fr.fmuser.org ->French
      gl.fmuser.org ->Galician
      ka.fmuser.org ->Georgian
      de.fmuser.org ->German
      el.fmuser.org ->Greek
      ht.fmuser.org ->Haitian Creole
      iw.fmuser.org ->Hebrew
      hi.fmuser.org ->Hindi
      hu.fmuser.org ->Hungarian
      is.fmuser.org ->Icelandic
      id.fmuser.org ->Indonesian
      ga.fmuser.org ->Irish
      it.fmuser.org ->Italian
      ja.fmuser.org ->Japanese
      ko.fmuser.org ->Korean
      lv.fmuser.org ->Latvian
      lt.fmuser.org ->Lithuanian
      mk.fmuser.org ->Macedonian
      ms.fmuser.org ->Malay
      mt.fmuser.org ->Maltese
      no.fmuser.org ->Norwegian
      fa.fmuser.org ->Persian
      pl.fmuser.org ->Polish
      pt.fmuser.org ->Portuguese
      ro.fmuser.org ->Romanian
      ru.fmuser.org ->Russian
      sr.fmuser.org ->Serbian
      sk.fmuser.org ->Slovak
      sl.fmuser.org ->Slovenian
      es.fmuser.org ->Spanish
      sw.fmuser.org ->Swahili
      sv.fmuser.org ->Swedish
      th.fmuser.org ->Thai
      tr.fmuser.org ->Turkish
      uk.fmuser.org ->Ukrainian
      ur.fmuser.org ->Urdu
      vi.fmuser.org ->Vietnamese
      cy.fmuser.org ->Welsh
      yi.fmuser.org ->Yiddish

       
  •  

    FMUSER Wirless Transmit Video And Audio More Easier !

  • Contact

    Address:
    No.305 Room HuiLan Building No.273 Huanpu Road Guangzhou China 510620

    E-mail:
    [email protected]

    Tel / WhatApps:
    +8618078869184

  • Categories

  • Newsletter

    FIRST OR FULL NAME

    E-mail

  • paypal solution  Western UnionBank OF China
    E-mail:[email protected]   WhatsApp:+8618078869184   Skype:sky198710021 Chat with me
    Copyright 2006-2020 Powered By www.fmuser.org

    Contact Us