Skip to content

Commit

Permalink
Use file handle instead of socket for input
Browse files Browse the repository at this point in the history
  • Loading branch information
resetius committed Dec 5, 2023
1 parent c8a8a29 commit a09f796
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions client/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ TTestTask ClientReader(Poller& poller, typename Poller::TSocket& socket) {
template<typename Poller>
TSimpleTask Client(Poller& poller, TAddress addr) {
using TSocket = typename Poller::TSocket;
using TFileHandle = typename Poller::TFileHandle;
TSocket socket(std::move(addr), poller);
TSocket input{TAddress{}, 0, poller}; // stdin
TFileHandle input{0, poller}; // stdin
co_await socket.Connect();
std::cout << "Connected\n";
char buf[1024];
Expand All @@ -43,7 +44,7 @@ TSimpleTask Client(Poller& poller, TAddress addr) {
TLine line;
TCommandRequest header;
header.Type = static_cast<uint32_t>(TCommandRequest::MessageType);
auto lineReader = TLineReader<TSocket>(input, 2*1024, 1024);
auto lineReader = TLineReader(input, 2*1024, 1024);
auto byteWriter = TByteWriter(socket);

try {
Expand Down
2 changes: 1 addition & 1 deletion coroio

0 comments on commit a09f796

Please sign in to comment.