protected void Init(Socket s, ConnectMgr parentnotify) { this.Client = s; if ((this.Client != null) && (this.Client.Connected == true)) { NetworkStream = new NetworkStream(this.Client); } }
internal AcceptorManager(ConnectMgr conparent) { m_ConMgrParent = conparent; AcceptCallback = new AsyncCallback(OnAcceptReceived); }
public override SocketServer.SocketClient AcceptSocket(System.Net.Sockets.Socket s, SocketServer.ConnectMgr cmgr) { UniversalVideoSocketClient objNew = new UniversalVideoSocketClient(s, cmgr); return(objNew); }
public override SocketServer.SocketClient CreateSocket(System.Net.Sockets.Socket s, SocketServer.ConnectMgr cmgr) { return(new UniversalVideoSocketClient(s, cmgr)); }
public UniversalVideoSocketClient(System.Net.Sockets.Socket s, SocketServer.ConnectMgr cmgr) : base(s, cmgr) { }
public SocketClient(Socket s, ConnectMgr parentnotify) : this() { Init(s, parentnotify); }
public virtual SocketClient CreateSocket( Socket s, ConnectMgr cmgr ) { s.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveBuffer, 128000); return new SocketClient( s, cmgr ); }
public TCPRTPSocketClient(System.Net.Sockets.Socket s, SocketServer.ConnectMgr cmgr) : base(s, cmgr) { }
public override SocketServer.SocketClient AcceptSocket(System.Net.Sockets.Socket s, SocketServer.ConnectMgr cmgr) { TCPRTPSocketClient objNew = new TCPRTPSocketClient(s, cmgr); return(objNew); }
/// <summary> /// Creates a tcp connection asyncronously. The client muust call DoAsyncRead on connection completed /// </summary> /// <param name="ipaddr"></param> /// <param name="nport"></param> /// <returns></returns> public bool ConnectAsync(string ipaddr, int nport) { UserInitiatedDisconnect = false; IPAddress hostadd = null; IPEndPoint EPhost = null; if (ipaddr.Length <= 0) { return(false); } if (SOCKStrans.IsFilterActive == true) { /// Set our proxy remote location just in case we've been activated SOCKStrans.RemoteHost = ipaddr; SOCKStrans.RemotePort = nport; ipaddr = SOCKStrans.SocksHost; nport = SOCKStrans.SocksPort; } try { if (ConnectMgr.IsIPAddress(ipaddr) == true) { EPhost = new System.Net.IPEndPoint(System.Net.IPAddress.Parse(ipaddr), nport); } else { hostadd = ConnectMgr.Resolve(ipaddr); EPhost = new IPEndPoint(hostadd, nport); } } catch (SocketException e) /// could not resolve host name { if (m_Logger != null) { m_Logger.LogError(ToString(), MessageImportance.Highest, e.ToString()); } return(false); } //Creates the Socket for sending data over TCP. Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); // Connects to the host using IPEndPoint. try { s.BeginConnect(EPhost, m_AsyncConnect, s); } catch (SocketException e2) { if (m_Logger != null) { m_Logger.LogError(ToString(), MessageImportance.Highest, e2.ToString()); } return(false); } return(true); }
public virtual SocketClient CreateSocket(Socket s, ConnectMgr cmgr) { s.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveBuffer, 128000); return(new SocketClient(s, cmgr)); }