Debian Codegraph @

CodeLite/SocketAPI/clSocketClient.h

raw
1 //////////////////////////////////////////////////////////////////////////////
2 //////////////////////////////////////////////////////////////////////////////
3 //
4 // copyright : (C) 2014 Eran Ifrah
5 // file name : clSocketClient.h
6 //
7 // -------------------------------------------------------------------------
8 // A
9 // _____ _ _ _ _
10 // / __ \ | | | | (_) |
11 // | / \/ ___ __| | ___| | _| |_ ___
12 // | | / _ \ / _ |/ _ \ | | | __/ _ )
13 // | \__/\ (_) | (_| | __/ |___| | || __/
14 // \____/\___/ \__,_|\___\_____/_|\__\___|
15 //
16 // F i l e
17 //
18 // This program is free software; you can redistribute it and/or modify
19 // it under the terms of the GNU General Public License as published by
20 // the Free Software Foundation; either version 2 of the License, or
21 // (at your option) any later version.
22 //
23 //////////////////////////////////////////////////////////////////////////////
24 //////////////////////////////////////////////////////////////////////////////
25
26 #ifndef CLSOCKETCLIENT_H
27 #define CLSOCKETCLIENT_H
28
29 #include "clSocketBase.h"
30 #include <wx/string.h>
31
32 class WXDLLIMPEXP_CL clSocketClient : public clSocketBase
33 {
34 wxString m_path;
35
36 public:
37 clSocketClient();
38 virtual ~clSocketClient();
39
40 /**
41 * @brief connect to a remote socket, using unix-domain socket
42 */
43 bool ConnectLocal(const wxString& socketPath);
44 /**
45 * @brief connect to a remote server using ip/port
46 * when using non-blocking mode, wouldBlock will be set to true
47 * incase the connect fails
48 */
49 bool ConnectRemote(const wxString& address, int port, bool& wouldBlock, bool nonBlockingMode = false);
50
51 /**
52 * @brief connect using connection string
53 * @param connectionString in the format of unix:///path/to/unix/socket or tcp://127.0.0.1:1234
54 * @return
55 */
56 bool Connect(const wxString& connectionString, bool nonBlockingMode = false);
57
58 /**
59 * @brief connect using non-blocking method
60 */
61 bool ConnectNonBlocking(const wxString& connectionString, bool& wouldBlock);
62 };
63
64 #endif // CLSOCKETCLIENT_H