Anonymous user
Chat server: Difference between revisions
m
→{{header|C}}: mixing space and tabulation in indentation is always a bad idea!
(Add C example.) |
m (→{{header|C}}: mixing space and tabulation in indentation is always a bad idea!) |
||
Line 99:
A glitch occurs if a connection is made using the Telnet protocol - user names are preceded by garbled text.
<lang c>#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
Line 257 ⟶ 256:
int ChatLoop()
{
{
{
}
{
{
{
{
printf ("Unable to accept new connection.\n");
Line 298 ⟶ 297:
ntohs(cliinfo.sin_port));
FD_SET(handle, &status);
AddConnection(handle);
}
}
else
{
{
CloseConnection(i);
}
else
{
ClientText(i, buf, b);
}
}
}
}
}
int main (int argc, char*argv[])
{
{
}
{
}
{
}
}</lang>▼
▲ return 0;
▲</lang>
=={{header|CoffeeScript}}==
|