Nebula
Loading...
Searching...
No Matches
messageclient.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
13#include "net/tcpclient.h"
14#include "net/tcpmessagecodec.h"
15#include "util/queue.h"
16
17//------------------------------------------------------------------------------
18namespace Net
19{
21{
23public:
27 virtual ~MessageClient();
28
30 virtual Result Connect();
32 virtual void Disconnect();
33
35 virtual bool Send();
37 virtual const Ptr<IO::Stream>& GetSendStream();
39 virtual bool Recv();
41 virtual const Ptr<IO::Stream>& GetRecvStream();
42
43private:
48};
49
50//------------------------------------------------------------------------------
51} // namespace Net
Wrapper class for the Net::TcpClient that sends data in special message container.
Definition messageclient.h:21
Util::Queue< Ptr< IO::Stream > > msgQueue
Definition messageclient.h:47
virtual Result Connect()
establish a connection with the server
Definition messageclient.cc:40
virtual const Ptr< IO::Stream > & GetRecvStream()
access to recv stream
Definition messageclient.cc:132
Ptr< IO::Stream > recvMessageStream
Definition messageclient.h:46
virtual void Disconnect()
disconnect from the server
Definition messageclient.cc:56
MessageClient()
constructor
Definition messageclient.cc:19
virtual bool Send()
send accumulated content of send stream to server
Definition messageclient.cc:67
TcpMessageCodec codec
Definition messageclient.h:44
Ptr< IO::Stream > sendMessageStream
Definition messageclient.h:45
virtual ~MessageClient()
destructor
Definition messageclient.cc:27
virtual const Ptr< IO::Stream > & GetSendStream()
access to send stream
Definition messageclient.cc:85
virtual bool Recv()
receive data from server into recv stream
Definition messageclient.cc:94
__DeclareClass(MessageClient)
See StdTcpClient for details.
Helperclass that provides function to encode and decode sreams into messages.
Definition tcpmessagecodec.h:29
Nebula's smart pointer class which manages the life time of RefCounted objects.
Definition ptr.h:38
Nebula's queue class (a FIFO container).
Definition queue.h:28
Definition debugmessage.h:20