forked from CobaltFusion/DebugViewPP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSocketReader.h
More file actions
43 lines (34 loc) · 1.01 KB
/
Copy pathSocketReader.h
File metadata and controls
43 lines (34 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// (C) Copyright Gert-Jan de Vos and Jan Wilmans 2013.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#pragma once
#include <array>
#include "Win32/Win32Lib.h"
#include "Win32/Socket.h"
#include "LogSource.h"
namespace fusion {
namespace debugviewpp {
class ILineBuffer;
class SocketReader : public LogSource
{
public:
SocketReader(Timer& timer, ILineBuffer& lineBuffer, int port);
[[nodiscard]] HANDLE GetHandle() const override;
void Notify() override;
private:
int BeginReceive();
int CompleteReceive();
[[nodiscard]] std::string GetProcessText() const;
Win32::WinsockInitialization m_wsa;
Win32::Socket m_socket;
Win32::Handle m_event;
std::array<char, 2000> m_buffer;
WSAOVERLAPPED m_overlapped = WSAOVERLAPPED();
WSABUF m_wsaBuf[1]{};
sockaddr_in m_from = sockaddr_in();
int m_fromLen;
bool m_busy;
};
} // namespace debugviewpp
} // namespace fusion