OpenCores
URL https://opencores.org/ocsvn/riscv_vhdl/riscv_vhdl/trunk

Subversion Repositories riscv_vhdl

[/] [riscv_vhdl/] [trunk/] [debugger/] [src/] [libdbg64g/] [services/] [remote/] [tcpserver.h] - Blame information for rev 5

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 sergeykhbr
/**
2
 * @file
3
 * @copyright  Copyright 2017 GNSS Sensor Ltd. All right reserved.
4
 * @author     Sergey Khabarov - sergeykhbr@gmail.com
5
 * @brief      Remote access to debugger via TCP connection. Server side.
6
 */
7
 
8
#ifndef __DEBUGGER_TCPSERVER_H__
9
#define __DEBUGGER_TCPSERVER_H__
10
 
11
#include <iclass.h>
12
#include <iservice.h>
13
#include "coreservices/ithread.h"
14
#include "tcpclient.h"
15
 
16
namespace debugger {
17
 
18
class TcpServer : public IService,
19
                  public IThread {
20
 public:
21
    explicit TcpServer(const char *name);
22
 
23
    /** IService interface */
24
    virtual void postinitService();
25
 
26
 protected:
27
    /** IThread interface */
28
    virtual void busyLoop();
29
 
30
 protected:
31
    int createServerSocket();
32
    void closeServerSocket();
33
    void setRcvTimeout(socket_def skt, int timeout_ms);
34
    bool setBlockingMode(bool mode);
35
 
36
 private:
37
    AttributeType isEnable_;
38
    AttributeType timeout_;
39
    AttributeType blockmode_;
40
    AttributeType hostIP_;
41
    AttributeType hostPort_;
42
 
43
    struct sockaddr_in sockaddr_ipv4_;
44
    socket_def hsock_;
45
    char rcvbuf[4096];
46
};
47
 
48
DECLARE_CLASS(TcpServer)
49
 
50
}  // namespace debugger
51
 
52
#endif  // __DEBUGGER_TCPSERVER_H__

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.