diff options
Diffstat (limited to 'include/pso/TTcpSocket.h')
-rw-r--r-- | include/pso/TTcpSocket.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/include/pso/TTcpSocket.h b/include/pso/TTcpSocket.h new file mode 100644 index 0000000..9740a3a --- /dev/null +++ b/include/pso/TTcpSocket.h @@ -0,0 +1,41 @@ +#ifndef TTCPSOCKET_H +#define TTCPSOCKET_H + +#include <global_types.h> +#include <string.h> +#include <pso/macros.h> +#include <pso/forward.h> +#include <pso/PSOV3EncryptionTCP.h> +#include <pso/TArray.h> +#include <pso/TSocket.h> +#include <pso/TObject.h> + +EXTERN_OBJECT_NAME(TTcpSocket); +extern TTcpSocket *tcp_socket_table[16]; + +class TTcpSocket : public TSocket { +private: + PSOV3EncryptionTCP m_send_crypt; + PSOV3EncryptionTCP m_recv_crypt; + int m_is_encrypted; +public: + WEAK_FUNC TTcpSocket(TObject *parent = nullptr); + virtual ~TTcpSocket(); + + virtual short open() override; + virtual short close() override; + virtual void recv() override; + virtual short send(u8 *data) override; + virtual int send(u8 *data, size_t size) override; + + int stat(); + int test_connection(); + + static void notify(short size, short sock_fd); + + PRIVATE_MEMBER_ACCESSORS(PSOV3EncryptionTCP, send_crypt); + PRIVATE_MEMBER_ACCESSORS(PSOV3EncryptionTCP, recv_crypt); + PRIVATE_MEMBER_ACCESSORS(int, is_encrypted); +}; + +#endif |