This commit is contained in:
aozhiwei 2022-12-16 18:55:11 +08:00
parent b9b2211ab2
commit 3ceb978f38
2 changed files with 0 additions and 49 deletions

View File

@ -5,7 +5,6 @@
#include "f8/protoutils.h"
#include <a8/tcpclient.h>
#include <a8/asynctcpclient.h>
#include <a8/tcplistener.h>
#include <google/protobuf/message.h>
@ -127,25 +126,6 @@ namespace f8
return sizeof(f8::PackHeadOld) + packlen;
}
int Net_SendMsg(a8::AsyncTcpClient* tcp_client, unsigned seqid, unsigned short msgid,
const ::google::protobuf::Message& msg)
{
int packlen = msg.ByteSize();
assert(packlen < 1024 * 60);
char* buff = (char*)malloc(sizeof(PackHead) + packlen);
PackHead* head = (PackHead*)buff;
head->packlen = packlen;
head->msgid = msgid;
head->seqid = seqid;
head->magic_code = MAGIC_CODE;
head->ext_len = 0;
msg.SerializeToArray(buff + sizeof(PackHead), packlen);
tcp_client->SendBuff(buff, sizeof(PackHead) + packlen);
free(buff);
return sizeof(PackHead) + packlen;
}
int Net_SendBigMsg(a8::TcpClient* tcp_client, unsigned seqid, unsigned short msgid,
::google::protobuf::Message& msg)
{
@ -276,30 +256,6 @@ namespace f8
return sizeof(WSProxyPackHead_C) + packlen;
}
int Net_SendProxyCMsg(a8::AsyncTcpClient* tcp_client, unsigned short socket_handle,
unsigned short msgid, ::google::protobuf::Message& msg)
{
int packlen = msg.ByteSize();
assert(packlen < 1024 * 60);
char* buff = (char*)malloc(sizeof(WSProxyPackHead_C) + packlen);
memset(buff, 0, sizeof(WSProxyPackHead_C));
WSProxyPackHead_C* head = (WSProxyPackHead_C*)buff;
head->packlen = packlen;
head->msgid = msgid;
head->seqid = 0;
head->magic_code = MAGIC_CODE;
head->ip_saddr = 0;
head->socket_handle = socket_handle;
if (packlen > 0) {
msg.SerializeToArray(buff + sizeof(WSProxyPackHead_C), packlen);
}
tcp_client->SendBuff(buff, sizeof(WSProxyPackHead_C) + packlen);
free(buff);
return sizeof(WSProxyPackHead_C) + packlen;
}
int Net_SendProxyMsg(a8::TcpListener* tcp_listener, int socket_handle,
unsigned int seqid, unsigned short error_code,
unsigned short msgid, ::google::protobuf::Message& msg)

View File

@ -12,7 +12,6 @@ namespace google
namespace a8
{
class TcpClient;
class AsyncTcpClient;
class TcpListener;
}
@ -95,8 +94,6 @@ namespace f8
unsigned short msgid, const ::google::protobuf::Message& msg);
int Net_SendMsgOld(a8::TcpClient* tcp_client, unsigned int seqid,
unsigned short msgid, ::google::protobuf::Message& msg);
int Net_SendMsg(a8::AsyncTcpClient* tcp_client, unsigned int seqid,
unsigned short msgid, const ::google::protobuf::Message& msg);
int Net_SendBigMsg(a8::TcpClient* tcp_client, unsigned int seqid,
unsigned short msgid, ::google::protobuf::Message& msg);
int Net_SendMsg(a8::TcpClient* tcp_client, unsigned int seqid, unsigned short msgid,
@ -114,8 +111,6 @@ namespace f8
int Net_SendProxyCMsg(a8::TcpClient* tcp_client, unsigned short socket_handle,
unsigned short msgid, ::google::protobuf::Message& msg);
int Net_SendProxyCMsg(a8::AsyncTcpClient* tcp_client, unsigned short socket_handle,
unsigned short msgid, ::google::protobuf::Message& msg);
int Net_SendProxyMsg(a8::TcpListener* tcp_tlistener, int socket_handle,
unsigned int seqid, unsigned short error_code,