public DistSession GetSession(string sessionName, bool create = false, bool global = false, ServerPriority prio = ServerPriority.PRIO_NORMAL) { return(manager.DistSessionInstanceManager.GetSession(DistClient_getSession(GetNativeReference(), sessionName, create, global, prio))); }
private static extern IntPtr DistClient_getSession(IntPtr client, string sessionName, bool create, bool global, ServerPriority prio);
private static extern IntPtr DistManager_getSession(IntPtr manager, string sessionName, bool create, bool global, ServerPriority prio);
public DistSession GetSession(string sessionName, bool create = false, bool global = false, ServerPriority prio = ServerPriority.PRIO_NORMAL) { IntPtr s = DistManager_getSession(GetNativeReference(), sessionName, create, global, prio); DistSession session = ReferenceDictionary <DistSession> .GetObject(s); if (session == null) { session = new DistSession(s); } return(session); }
internal VirtualServer Add(string Host, string Username = "", string Password = "", int Port = 119, int MaxConnections = 1, bool SSL = false, ServerPriority Priority = ServerPriority.Default) { VirtualServer SrvInfo = new VirtualServer(Connections, Host, Username, Password, Port, MaxConnections, SSL, Priority); if (!zServers.Add(SrvInfo)) { return(null); } for (int iC = 0; iC < SrvInfo.Allowed; iC++) { Connections.Add(SrvInfo.ID); } return(SrvInfo); }
internal VirtualServer(Connections lConnections, string Host, string Username = "", string Password = "", int Port = 119, int Connections = 1, bool SSL = false, ServerPriority Priority = ServerPriority.Default) { zSSL = SSL; zHost = Host; zPort = Port; zCon = lConnections; zPriority = Priority; zConnections = Connections; if (Username != null) { zUsername = Username; } else { zUsername = ""; }; if (Password != null) { zPassword = Password; } else { zPassword = ""; }; }
//internal VirtualServer Get(int ID) { lock (zServers) { return zServers.Item(ID); } } public int Add(string Host, string Username = "", string Password = "", int Port = 119, int Connections = 1, bool SSL = false, ServerPriority Priority = ServerPriority.Default) { lock (zServers) { VirtualServer vSched = zServers.Add(Host, Username, Password, Port, Connections, SSL, Priority); if (vSched == null) { return(-1); } return(vSched.ID); } }