Click here to Skip to main content
15,894,740 members
Articles / Programming Languages / C#

STUN Client

Rate me:
Please Sign up or sign in to vote.
4.83/5 (36 votes)
20 Apr 2007CPOL 329K   14.9K   85  
STUN client C# implementation with sample application
using System;
using System.Net;

namespace LumiSoft.Net
{
	/// <summary>
	/// Common interface for socket server sessions.
	/// </summary>
	public interface ISocketServerSession
    {
        #region method Kill

        /// <summary>
        /// Kills session.
        /// </summary>
        void Kill();

        #endregion

        #region method OnSessionTimeout

        /// <summary>
		/// For internal use only !
		/// </summary>
		void OnSessionTimeout();

        #endregion


        #region Properties Implemtation

        /// <summary>
		/// Gets session ID.
		/// </summary>
		string SessionID
		{
			get;
		}

        /// <summary>
		/// Gets session start time.
		/// </summary>
		DateTime SessionStartTime
		{
			get;
		}

        /// <summary>
        /// Gets how many seconds has left before timout is triggered.
        /// </summary>
        int ExpectedTimeout
        {
            get;
        }

        /// <summary>
		/// Gets last data activity time.
		/// </summary>
		DateTime SessionLastDataTime
		{
			get;
        }

        /// <summary>
		/// Gets loggded in user name (session owner).
		/// </summary>
		string UserName
		{
			get;
		}

        /// <summary>
		/// Gets EndPoint which accepted conection.
		/// </summary>
		IPEndPoint LocalEndPoint
		{
			get;
		}

		/// <summary>
		/// Gets connected Host(client) EndPoint.
		/// </summary>
		IPEndPoint RemoteEndPoint
		{
			get;
		}
		
		/// <summary>
		/// Gets or sets custom user data.
		/// </summary>
		object Tag
		{
			get;

			set;
		}

        /// <summary>
        /// Gets log entries that are currently in log buffer.
        /// </summary>
        SocketLogger SessionActiveLog
        {
            get;
        }

        /// <summary>
        /// Gets how many bytes are readed through this session.
        /// </summary>
        long ReadedCount
        {
            get;
        }
        
        /// <summary>
        /// Gets how many bytes are written through this session.
        /// </summary>
        long WrittenCount
        {
            get;
        }
        
        /// <summary>
        /// Gets if the connection is an SSL connection.
        /// </summary>
        bool IsSecureConnection
        {
            get;
        }

        #endregion
    }
}

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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Estonia Estonia
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions