Model.NetworkComponent.Create C# (CSharp) Method

Create() public method

创建一个新Session
public Create ( string address ) : Model.Session
address string
return Model.Session
		public Session Create(string address)
		{
			string[] ss = address.Split(':');
			int port = int.Parse(ss[1]);
			string host = ss[0];
			AChannel channel = this.Service.ConnectChannel(host, port);
			Session session = new Session(this, channel);
			channel.ErrorCallback += (c, e) => { this.Remove(session.Id); };
			this.sessions.Add(session.Id, session);
			return session;
		}