2013-07-12 21:30:13 +02:00
|
|
|
/*****************************************************************************
|
|
|
|
* SocketAsyncEventArgs.h *
|
|
|
|
* *
|
2014-07-14 15:03:46 +02:00
|
|
|
* System::Net::Sockets::SocketAsyncEventArgs class definition file. *
|
2013-10-03 17:38:47 +02:00
|
|
|
* Copyright (c) XFX Team. All rights reserved. *
|
2013-07-12 21:30:13 +02:00
|
|
|
*****************************************************************************/
|
2013-05-05 18:18:41 +02:00
|
|
|
#ifndef _SYSTEM_NET_SOCKETS_SOCKETASYNCEVENTARGS_
|
|
|
|
#define _SYSTEM_NET_SOCKETS_SOCKETASYNCEVENTARGS_
|
|
|
|
|
|
|
|
#include <System/Event.h>
|
|
|
|
#include "../Endpoint.h"
|
|
|
|
#include "Socket.h"
|
|
|
|
#include "Enums.h"
|
|
|
|
#include <System/Object.h>
|
|
|
|
#include <System/Types.h>
|
|
|
|
|
|
|
|
namespace System
|
|
|
|
{
|
|
|
|
namespace Net
|
|
|
|
{
|
|
|
|
namespace Sockets
|
|
|
|
{
|
2014-07-14 15:03:46 +02:00
|
|
|
class SocketAsyncEventArgs : public EventArgs, public IDisposable
|
2013-05-05 18:18:41 +02:00
|
|
|
{
|
2014-07-14 15:03:46 +02:00
|
|
|
private:
|
2014-07-22 17:02:45 +02:00
|
|
|
int count;
|
|
|
|
Socket* curSocket;
|
|
|
|
int inProgress;
|
|
|
|
bool isDisposed;
|
|
|
|
SocketAsyncOperation_t lastOperation;
|
|
|
|
int offset;
|
2014-07-14 15:03:46 +02:00
|
|
|
friend class Socket;
|
|
|
|
|
2014-07-22 17:02:45 +02:00
|
|
|
void SetBufferInternal(byte buffer[], int offset, int count);
|
|
|
|
void SetLastOperation(SocketAsyncOperation_t op);
|
|
|
|
|
2013-05-05 18:18:41 +02:00
|
|
|
protected:
|
|
|
|
virtual void Oncompleted(SocketAsyncEventArgs* e);
|
|
|
|
virtual ~SocketAsyncEventArgs();
|
|
|
|
|
|
|
|
public:
|
2014-07-14 15:03:46 +02:00
|
|
|
byte * getBuffer() const;
|
2013-05-05 18:18:41 +02:00
|
|
|
int getBytesTransferred() const;
|
|
|
|
//Exception* getConnectByNameError() const;
|
2014-07-14 15:03:46 +02:00
|
|
|
Socket * getConnectSocket() const;
|
|
|
|
int Count() const;
|
2013-05-05 18:18:41 +02:00
|
|
|
SocketAsyncOperation_t getLastOperation() const;
|
|
|
|
int getOffset() const;
|
|
|
|
EndPoint* RemoteEndPoint;
|
|
|
|
SocketError_t SocketError;
|
|
|
|
Object* UserToken;
|
|
|
|
|
|
|
|
EventHandler Completed;
|
|
|
|
|
|
|
|
SocketAsyncEventArgs();
|
2014-07-22 17:02:45 +02:00
|
|
|
~SocketAsyncEventArgs();
|
2013-05-05 18:18:41 +02:00
|
|
|
|
|
|
|
void Dispose();
|
2013-07-12 21:30:13 +02:00
|
|
|
static const Type& GetType();
|
2013-05-05 18:18:41 +02:00
|
|
|
void SetBuffer(const int offset, const int count);
|
|
|
|
void SetBuffer(byte buffer[], const int offset, const int count);
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif //_SYSTEM_NET_SOCKETS_SOCKETASYNCEVENTARGS_
|