Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Caco
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Harbor Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vytor Calixto
Caco
Commits
93355d56
Commit
93355d56
authored
9 years ago
by
Vytor Calixto
Browse files
Options
Downloads
Patches
Plain Diff
Fixed some bugs on transmit
parent
c08579f7
No related branches found
No related tags found
1 merge request
!1
Lento
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Protocol.cpp
+7
-1
7 additions, 1 deletion
Protocol.cpp
test.sh
+2
-0
2 additions, 0 deletions
test.sh
with
9 additions
and
1 deletion
Protocol.cpp
+
7
−
1
View file @
93355d56
...
@@ -154,7 +154,13 @@ void Protocol::transmit(int sockt, int window){
...
@@ -154,7 +154,13 @@ void Protocol::transmit(int sockt, int window){
printf
(
"astoi %i
\n
"
,
response
.
getMessages
().
back
().
getDataAsString
()[
0
]);
printf
(
"astoi %i
\n
"
,
response
.
getMessages
().
back
().
getDataAsString
()[
0
]);
int
ackIndex
=
response
.
getMessages
().
back
().
getDataAsString
()[
0
];
int
ackIndex
=
response
.
getMessages
().
back
().
getDataAsString
()[
0
];
for
(
int
j
=
0
;
j
<
frame
.
size
();)
{
for
(
int
j
=
0
;
j
<
frame
.
size
();)
{
if
(
frame
[
j
].
index
<=
ackIndex
)
{
cout
<<
"ackIndex: "
<<
ackIndex
<<
"frame[j].index: "
<<
frame
[
j
].
index
<<
endl
;
if
(
ackIndex
==
0
)
{
if
((
frame
[
j
].
index
%
(
MAXSIZE
+
1
))
==
62
||
(
frame
[
j
].
index
%
(
MAXSIZE
+
1
))
==
63
||
(
frame
[
j
].
index
%
(
MAXSIZE
+
1
))
==
0
)
{
frame
.
erase
(
frame
.
begin
()
+
j
);
--
messagesLeft
;
}
else
++
j
;
}
else
if
((
frame
[
j
].
index
%
(
MAXSIZE
+
1
))
<=
ackIndex
)
{
frame
.
erase
(
frame
.
begin
()
+
j
);
frame
.
erase
(
frame
.
begin
()
+
j
);
--
messagesLeft
;
--
messagesLeft
;
}
else
++
j
;
}
else
++
j
;
...
...
This diff is collapsed.
Click to expand it.
test.sh
+
2
−
0
View file @
93355d56
#!/bin/bash
#!/bin/bash
rm
10.txt 100.txt 1000.txt
for
i
in
{
1..10
}
for
i
in
{
1..10
}
do
do
echo
-e
"
$i
\n
"
>>
10.txt
echo
-e
"
$i
\n
"
>>
10.txt
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment