Message from C, C++ talks

June 2019

— Yes

— Communicate with 1 client at the time is easy

— Take a look on long polling

— Probably he's having the issue he's responding on the port being connected to, making it unavailable to other clients

Message permanent page

— 

You know, Emile, you can respond from a different port on the request to keep the host-port open for multiple connections?

— 

#include <iostream>
int main()
{
char letters[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
char oletters[] = "0123456789";
char random_name[5];
for(int i = 0; i < 5; i++)
{
switch(i)
{
case 0: random_name[i] = letters[rand() % 26]; break;
case 1: random_name[i] = letters[rand() % 26]; break;
case 2: random_name[i] = oletters[rand() % 10]; break;
case 3: random_name[i] = oletters[rand() % 10]; break;
case 4: random_name[i] = oletters[rand() % 10]; break;
default: break;
}
}
std::cout << "Random name thus generated is: " << random_name;
return 0;
}

Please check is this program correct?

Message permanent page

— Mate, could u check it ?

— Well I did

— I'm not getting expected results

— Use debugger

— And watch where it goes wrong

— But I was supposed to get something lke
BS123 etc. etc.

— Only 5 letters not more

— Then watch after your algorithm

— Suggest me one