wavelength 1.0.0
Loading...
Searching...
No Matches
asyncinfo.h
Go to the documentation of this file.
1#pragma once
2
4
13class AsyncInfo {
14public:
16 enum List {
19 };
20
30
40
47 void AppendRead();
48
55 void AppendSend();
56
65 static AsyncInfo *FindRead(int cid);
66
75 static AsyncInfo *FindSend(int cid);
76
86 static bool StopReadThread(int cid, int timeout);
87
97 static bool StopSendThread(int cid, int timeout);
98
106 static void DumpList(int list);
107
119 int PollBlocks(bool blocks, bool sending, bool *available);
120
123
126
130 unsigned int mReserved;
131 int mCid;
133 unsigned int mBufferSize;
134 unsigned char *mBufferStart;
137 int mThid;
138 unsigned char *mOtherWriteLoc;
139 int mClose;
140 int mType;
142 unsigned int mWriteOffset;
143
144private:
152 static void TcpReceiveThread(void *transfer);
153
161 static void BlockReceiveThread(void *transfer);
162
170 static void TcpSendThread(void *transfer);
171
179 static void BlockSendThread(void *transfer);
180
187 void RemoveRead();
188
195 void RemoveSend();
196
206 int SendBlock(int kind, const char *name);
207
217 int ReceiveBlock(int kind, const char *name);
218
231 int ReserveBlock(unsigned int size, unsigned int *reserved, bool *ready);
232
242 int FindFilledBlock(AsyncBlock **block, bool *found);
243
252 static inline void CopyToEe(const void *data, void *destination, int size, const char *message);
253
263 inline bool StartThread(const char *name,
264 void (*blockEntry)(void *),
265 void (*streamEntry)(void *),
266 int priority);
267};
Header of one datagram in the ring buffer of an AsyncInfo.
Definition asyncblock.h:12
An asynchronous transfer on one connection, as the EE describes it to the module.
Definition asyncinfo.h:13
int mCid
Definition asyncinfo.h:131
bool StartSendThread()
Start the thread that sends on the connection.
int mLastReturnedFlag
Definition asyncinfo.h:128
static AsyncInfo * FindRead(int cid)
Find the receiving transfer of a connection.
static void DumpList(int list)
Print the transfers of one list and the state of their threads.
unsigned int mWriteOffset
Definition asyncinfo.h:142
void AppendSend()
Add the transfer to the sending list.
void AppendRead()
Add the transfer to the receiving list.
static AsyncInfo * sSendList
First transfer of the sending list.
Definition asyncinfo.h:125
unsigned char * mOtherWriteLoc
Definition asyncinfo.h:138
int mThid
Definition asyncinfo.h:137
int mMaxPacketSize
Definition asyncinfo.h:129
static bool StopReadThread(int cid, int timeout)
Stop and delete the receiving thread of a connection, then remove and free its transfer.
int mClose
Definition asyncinfo.h:139
static AsyncInfo * sReadList
First transfer of the receiving list.
Definition asyncinfo.h:122
AsyncInfo * mOtherProcessorsInfo
Definition asyncinfo.h:135
static bool StopSendThread(int cid, int timeout)
Stop and delete the sending thread of a connection, then remove and free its transfer.
bool StartReadThread()
Start the thread that receives on the connection.
static AsyncInfo * FindSend(int cid)
Find the sending transfer of a connection.
unsigned char * mBufferStart
Definition asyncinfo.h:134
unsigned int mReserved
Definition asyncinfo.h:130
int mType
Definition asyncinfo.h:140
int mDataWaitingSize
Definition asyncinfo.h:127
int PollBlocks(bool blocks, bool sending, bool *available)
Report whether data is waiting.
AsyncInfo * mNext
Definition asyncinfo.h:136
int mInetFlag
Definition asyncinfo.h:132
List
Lists DumpList() can display.
Definition asyncinfo.h:16
@ kListRead
Definition asyncinfo.h:17
@ kListSend
Definition asyncinfo.h:18
unsigned int mBufferSize
Definition asyncinfo.h:133
int mRemotePort
Definition asyncinfo.h:141