Skip to content

Commit 0e8c36f

Browse files
committed
修复linux下不可用的问题
1 parent c47befd commit 0e8c36f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CodeFormatServer/src/Session/IOSession.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ int IOSession::Run(asio::io_context& ioc)
2525
while(true)
2626
{
2727
ioc.run();
28+
ioc.reset();
2829
std::this_thread::sleep_for(std::chrono::milliseconds(1));
2930
}
3031
});

CodeFormatServer/src/Session/StandardIOSession.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#ifndef _WIN32
66
#include <unistd.h>
77
#endif
8+
#include <thread>
9+
810
#include "CodeFormatServer/Protocol/ProtocolParser.h"
911
#include "CodeFormatServer/Protocol/ProtocolBuffer.h"
1012

@@ -56,7 +58,6 @@ bool StandardIO::HasError()
5658
void StandardIO::Write(std::string_view content)
5759
{
5860
asio::write(*_out, asio::buffer(content.data(), content.size()));
59-
std::cout.flush();
6061
}
6162

6263
#else

0 commit comments

Comments
 (0)