Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CS744 DECS-PA4-KEYVALUE-SERVER
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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kamal Khodabhai
CS744 DECS-PA4-KEYVALUE-SERVER
Commits
8ac3f93b
Commit
8ac3f93b
authored
Nov 17, 2021
by
mayankkakad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding new server tested and corrected
parent
45626f12
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
109 additions
and
53 deletions
+109
-53
dns.cpp
dns.cpp
+1
-19
server.cpp
server.cpp
+108
-34
No files found.
dns.cpp
View file @
8ac3f93b
...
@@ -69,6 +69,7 @@ public:
...
@@ -69,6 +69,7 @@ public:
fout
<<
info
.
address
()
<<
endl
;
fout
<<
info
.
address
()
<<
endl
;
fout
.
close
();
fout
.
close
();
null
.
set_nothing
(
0
);
null
.
set_nothing
(
0
);
cout
<<
info
.
address
()
<<
endl
;
addAddressResponder
.
Finish
(
null
,
Status
::
OK
,
this
);
addAddressResponder
.
Finish
(
null
,
Status
::
OK
,
this
);
}
}
else
{
else
{
...
@@ -76,30 +77,11 @@ public:
...
@@ -76,30 +77,11 @@ public:
status
=
FINISH
;
status
=
FINISH
;
}
}
else
{
else
{
if
(
reqType
==
ADDADDRESS
)
print_servers_list
();
GPR_ASSERT
(
status
==
FINISH
);
GPR_ASSERT
(
status
==
FINISH
);
delete
this
;
delete
this
;
}
}
}
}
void
print_servers_list
()
{
ifstream
fin
;
map
<
int
,
string
>
servers
;
int
size
=
0
;
fin
.
open
(
SERVERS
);
do
{
string
temp
;
getline
(
fin
,
temp
);
if
(
temp
.
size
()
==
0
)
break
;
servers
[
size
++
]
=
temp
;
}
while
(
fin
);
fin
.
close
();
for
(
int
i
=
0
;
i
<
size
;
i
++
)
cout
<<
servers
.
find
(
i
)
->
second
<<
endl
;
}
private:
private:
KeyValueServices
::
AsyncService
*
service
;
KeyValueServices
::
AsyncService
*
service
;
ServerCompletionQueue
*
cq
;
ServerCompletionQueue
*
cq
;
...
...
server.cpp
View file @
8ac3f93b
This diff is collapsed.
Click to expand it.
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