diff options
Diffstat (limited to 'source/cSocket.cpp')
-rw-r--r-- | source/cSocket.cpp | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/source/cSocket.cpp b/source/cSocket.cpp index 90c31f58d..fa016762c 100644 --- a/source/cSocket.cpp +++ b/source/cSocket.cpp @@ -2,12 +2,11 @@ #include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
#include "cSocket.h"
+#include "packets/cPacket.h"
#ifndef _WIN32
#include <netdb.h>
#include <unistd.h>
- // #include <sys/socket.h>
- // #include <netinet/in.h>
#include <arpa/inet.h> //inet_ntoa()
#else
#define socklen_t int
@@ -273,6 +272,28 @@ int cSocket::Send(const char * a_Buffer, unsigned int a_Length) +int cSocket::Send(const cPacket * a_Packet)
+{
+ AString Serialized;
+ a_Packet->Serialize(Serialized);
+ return Send(Serialized.data(), Serialized.size());
+}
+
+
+
+
+
+int cSocket::Send(const cPacket & a_Packet)
+{
+ AString Serialized;
+ a_Packet.Serialize(Serialized);
+ return Send(Serialized.data(), Serialized.size());
+}
+
+
+
+
+
unsigned short cSocket::GetPort(void) const
{
assert(IsValid());
|