• MessageServer

Contents

MessageServer

Namespace: Shared.Communication

Assembly: SharedLib

TCP Server object

Constructors

#ctor(Int32) Create a message server that listens on the indicated port

Properties

Running Indicates wether the server is running or not
LoginRequird Indicates wether clients need to login
MaxClientConnections Maximum number of Client Connections
ClientTimeOut Determintes the number of seconds the client received/sent data before timeout (0 = no limit)
AcceptFiles Determines wether the server accepts files or not
MaximumFileSize Maximum file size in bytes that the server will accept
ClientDictionary Returns the client dictionary
Port Retrieves the port being used by Message Server

Methods

SendMessage(Shared.Communication.Message, Boolean) Sends a message to all connected clients (broadcast)
Start(String) Starts a new Message Server listening thread, with a specific name
Start() Starts a new Message Server listening thread
Stop() Stops the Server
UserName(String) Returns the logged in user name for a Client
UserData(String) retrieves user defined data for the client connection
UserData(String, Object) Sets user defined data for the client connection
sendMessage(String, Net.Sockets.TcpClient, Shared.Communication.Message) Sends the actual message to individual client
sendMessage(Shared.Communication.Message, String, Boolean) Sends a message to an individual client based on logged on username
IsRunning() Determines wether the server is running or not
ProcessCommand(Shared.Communication.Message, Boolean) Processes internal command messages from clients
HandleClientException(Exception, String, Net.Sockets.TcpClient) Handles exceptions when handling client connections
ConnectedClientCount() Determines how many clients are currently connected
ClientAddress(Net.Sockets.TcpClient) Retrieves the clients ip address
RaiseAllowClientConnect(String) Raises event to indicates a client want to connects
RaiseClientConnected(String, String) Raises the ClientConnected event handler
RaiseError(Exception) Raises Internal error event handler
RaiseClientDisconnected(String, String) Raised the ClientDisconnected event handler
RaiseStarted() Raises the Started Event
RaiseStopped() Raises the stopped event
RaiseClientCommand(Shared.Communication.Message) Raises Client Command event
RaiseOnLogin(String, String, String) Raises an event to indicate the client wants to login
RaiseFileReceived(Object, Shared.Communication.TransferFileEventArgs) Raise a file received event Contains progess of file received/sent
RaiseFileReceive(String, String) Raises a FileReceive event

In This Document