Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3301531
D3144.id9485.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D3144.id9485.diff
View Options
diff --git a/native/cpp/CommonCpp/grpc/Client.h b/native/cpp/CommonCpp/grpc/Client.h
--- a/native/cpp/CommonCpp/grpc/Client.h
+++ b/native/cpp/CommonCpp/grpc/Client.h
@@ -48,6 +48,14 @@
void assignSetReadyStateCallback(std::function<void(SocketStatus)> callback);
std::string sessionSignature(std::string deviceID);
+ std::string newSession(
+ std::string deviceID,
+ std::string publicKey,
+ std::string signature,
+ std::string notifyToken,
+ tunnelbroker::NewSessionRequest_DeviceTypes deviceType,
+ std::string deviceAppVersion,
+ std::string deviceOS);
};
} // namespace network
diff --git a/native/cpp/CommonCpp/grpc/Client.cpp b/native/cpp/CommonCpp/grpc/Client.cpp
--- a/native/cpp/CommonCpp/grpc/Client.cpp
+++ b/native/cpp/CommonCpp/grpc/Client.cpp
@@ -140,5 +140,32 @@
return response.tosign();
}
+std::string Client::newSession(
+ std::string deviceID,
+ std::string publicKey,
+ std::string signature,
+ std::string notifyToken,
+ tunnelbroker::NewSessionRequest_DeviceTypes deviceType,
+ std::string deviceAppVersion,
+ std::string deviceOS) {
+ grpc::ClientContext context;
+ tunnelbroker::NewSessionRequest request;
+ tunnelbroker::NewSessionResponse response;
+
+ request.set_deviceid(deviceID);
+ request.set_publickey(publicKey);
+ request.set_signature(signature);
+ request.set_notifytoken(notifyToken);
+ request.set_devicetype(deviceType);
+ request.set_deviceappversion(deviceAppVersion);
+ request.set_deviceos(deviceOS);
+
+ auto status{this->stub_->NewSession(&context, request, &response)};
+ if (!status.ok()) {
+ return std::string{};
+ }
+ return response.sessionid();
+}
+
} // namespace network
} // namespace comm
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 19, 2:28 AM (19 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2536286
Default Alt Text
D3144.id9485.diff (1 KB)
Attached To
Mode
D3144: [CommCoreModule] Fill out `newSession(...) => sessionID` boilerplate in `Client`
Attached
Detach File
Event Timeline
Log In to Comment