|
using System;
using System.Net.Sockets;
using System.Net;
namespace ServerCommonLibrary
{
/// <summary>
/// this class rappresents a socket connection
/// </summary>
public class SocketConnection : EventArgs
{
public SocketConnection(Socket sock)
{
this.Socket = sock;
}
public void SendData(byte[] data)
{
if (Socket != null && Socket.Connected)
{
Socket.Send(data);
}
}
//#### Socket instance
public Socket Socket { get; set; }
//#### IPAdress request from
public IPAddress IP
{
get { return Socket == null ? null : ((IPEndPoint)Socket.RemoteEndPoint).Address; }
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.