Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Windows API
  4. Multithread Chat-Server in c

Multithread Chat-Server in c

Scheduled Pinned Locked Moved Windows API
sysadminhelptutorialquestionannouncement
1 Posts 1 Posters 5 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    ultimate112
    wrote on last edited by
    #1

    Hey everybody, i want to create a chatserver by using c on a windows operating system. The clients should have something like a chatroom. But my problem is that i haven't any idear how to do it that every client get a own thread. I have already looked after codes on google but i couldn't find anything which runs in dev c on windows. Can somebody tell me how and where i have to create the threads? after accept or before?! This is the code of my server but without any threads.

    #pragma hdrstop
    #pragma argsused

    #include
    #include
    #include
    #include
    #include

    #define ausgabe_len 200
    #define BUF_LEN 1000
    // ===========
    // | SERVER |
    // ===========
    void main()
    {
    WORD Version = MAKEWORD(1, 1);
    WSADATA Data;
    SOCKET s_sock, c_sock;
    struct sockaddr_in server, client;
    int len, flag,i,pos;
    char ausgabe[ausgabe_len],buffer[BUF_LEN];
    int ausgabe_groesse;

    // Init Vars
    pos = 0;
    for(i=0; i

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups