Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
git-task-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Janaki Ram Puli
git-task-2
Commits
34d5e0dc
You need to sign in or sign up before continuing.
Commit
34d5e0dc
authored
Aug 01, 2021
by
guitarhero22
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP: Broadcasting
parent
3af1de7f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
server.c
server.c
+12
-1
No files found.
server.c
View file @
34d5e0dc
...
@@ -192,6 +192,17 @@ pfds[i] = pfds[*fd_count-1];
...
@@ -192,6 +192,17 @@ pfds[i] = pfds[*fd_count-1];
}
else
{
}
else
{
// We got some good data from a client
// We got some good data from a client
for
(
int
j
=
0
;
j
<
fd_count
;
j
++
)
{
// Send to everyone!
int
dest_fd
=
pfds
[
j
].
fd
;
// Except the listener and ourselves
if
(
dest_fd
!=
listener
&&
dest_fd
!=
sender_fd
)
{
if
(
send
(
dest_fd
,
buf
,
nbytes
,
0
)
==
-
1
)
{
perror
(
"send"
);
}
}
}
}
}
}
// END handle data from client
}
// END handle data from client
}
// END got ready-to-read from poll()
}
// END got ready-to-read from poll()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment