1
0
mirror of https://github.com/Halofreak1990/XFXFramework synced 2024-12-26 13:49:34 +01:00
Halofreak1990 e7a47c8ed9 Revamped the List class so that it can (properly) handle pointers as well
Added 'ValueTypes' Single and Double
Added some components in the new System::Net namespace
Added the Console class, which can be used to output text to the screen
Updated a bunch of structs to include the IComparable and IEquatable interfaces, and inheritance from Object to allow better interoperability between container classes and other types
Replaced all exception handling code with a report to stdout.txt - this will, I hope, eventually be reversed, but as of yet, there is no support for exceptions.

BEWARE! Even though all libraries correctly compile, you cannot use any class/structure that inherits from a template class, because stupid G++ wants to include exception handling for each template.
2011-11-07 01:29:50 +00:00

72 lines
1.9 KiB
C++

/********************************************************
* Socket.h *
* *
* XFX Socket class definition file *
* Based on Windows Phone Socket class. *
* Copyright © XFX Team. All Rights Reserved *
********************************************************/
#ifndef _SYSTEM_NET_SOCKET_
#define _SYSTEM_NET_SOCKET_
#include "Enums.h"
#include "../EndPoint.h"
#include <System/Interfaces.h>
#include <System/Object.h>
#include <xboxkrnl/xboxkrnl.h>
using namespace System;
namespace System
{
namespace Net
{
namespace Sockets
{
class SocketAsyncEventArgs;
class Socket : public IDisposable, virtual Object
{
private:
AddressFamily_t addressFamily;
bool isConnected;
HANDLE handle;
protected:
virtual ~Socket();
void Dispose(bool disposing);
public:
AddressFamily_t getAddressFamily();
int Available();
bool Connected();
HANDLE getHandle();
ProtocolType_t getProtocolType();
int ReceiveBufferSize;
EndPoint* getRemoteEndPoint();
int SendBufferSize;
short Ttl;
Socket(AddressFamily_t addressFamily, SocketType_t socketType, ProtocolType_t protocolType);
static void CancelConnectAsync(SocketAsyncEventArgs e);
void Close();
void Close(int timeOut);
static bool ConnectAsync(SocketType_t socketType, ProtocolType_t protocolType, SocketAsyncEventArgs e);
bool ConnectAsync(SocketAsyncEventArgs e);
void Dispose();
void EndConnect(IAsyncResult* asyncResult);
void EndDisconnect(IAsyncResult* asyncResult);
bool ReceiveAsync(SocketAsyncEventArgs e);
bool ReceiveFromAsync(SocketAsyncEventArgs e);
bool SendAsync(SocketAsyncEventArgs e);
bool SendToAsync(SocketAsyncEventArgs e);
void Shutdown(SocketShutdown_t how);
};
}
}
}
#endif //_SYSTEM_NET_SOCKET_