summaryrefslogtreecommitdiff
path: root/include/pso
diff options
context:
space:
mode:
Diffstat (limited to 'include/pso')
-rw-r--r--include/pso/TTcpSocket.h41
-rw-r--r--include/pso/forward.h2
2 files changed, 43 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
diff --git a/include/pso/forward.h b/include/pso/forward.h
index 165b9ad..1bc71cf 100644
--- a/include/pso/forward.h
+++ b/include/pso/forward.h
@@ -1,6 +1,8 @@
#ifndef FORWARD_H
#define FORWARD_H
+class TTcpSocket;
+class PSOV3EncryptionTCP;
class TSocket;
class THeap;
class TObject;