Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using ServerAppSpace;
- using System.Runtime.InteropServices;
- using ServerClassSpace;
- namespace ServerClassSpace
- {
- // [ProgId("ServerClassSpace.ServerClass")]
- public class ServerClass : MarshalByRefObject, IMyService
- {
- private IServerApp _theServer = null; //this will be used to hold the server application's address..
- public IServerApp TheMainServer
- {
- set
- {
- _theServer = value;
- }
- }
- #region IMyService Implementation
- //these functions are mainly used for transferring to requests of the clients to the server application...
- public void Logon(string machinename, string portno, string username)
- {
- _theServer.RegisterUser(machinename, portno, username);
- }
- public void Logoff(string machinename, string username)
- {
- _theServer.UnRegisterUser(machinename, username);
- }
- public void SendMessage(string sendermachine, string senderusername, string receiverusername, bool isGlobal, string msgString)
- {
- _theServer.SendMsg(sendermachine, senderusername, receiverusername, isGlobal, msgString);
- }
- public string GetMessage(string machinename)
- {
- return _theServer.GetMsgs(machinename);
- }
- public int GetPortNo()
- {
- return _theServer.ServerGivePortNo();
- }
- public bool CanUseThisName(string username)
- {
- return _theServer.UserNameExists(username);
- }
- #endregion
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement