Ejemplo n.º 1
0
 /// <summary>
 /// Sets the local variables
 /// </summary>
 /// <param name="_Port">Port to listen to</param>
 /// <param name="_FileName">Local resource to be send</param>
 /// <param name="_Interface">Pointer to the interface (for status updating)</param>
 /// <param name="_Nexus">Pointer to Nexus</param>
 public BinaryServer(int _Port, string _FileName, GraphicalInterface _Interface, Nexus.Nexus _Nexus)
 {
     Port = _Port;
     FileName = _FileName;
     Interface = _Interface;
     MainNexus = _Nexus;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Sets the Nexus pointer
 /// </summary>
 /// <param name="nexus"></param>
 public GraphicalInterface(Nexus.Nexus nexus)
 {
     _nexus = nexus;
     InitializeComponent();
     ListView_Search.View = View.Details;
     ListView_Search.FullRowSelect = true;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Sets the necessary variables
 /// </summary>
 /// <param name="_ServerIP">IP of the server to connect to</param>
 /// <param name="_Port">Port of the server to connect to</param>
 /// <param name="_FileName">Filename where the data has to be saved</param>
 /// <param name="_Nexus">Pointer to the central Nexus</param>
 /// <param name="_FileLength">The raw binary file lengt of the file to be received</param>
 public BinaryClient(string _ServerIP, int _Port, string _FileName, Nexus.Nexus _Nexus, long _FileLength)
 {
     FileName = _FileName;
     Port = _Port;
     ServerIP = _ServerIP;
     Nexus = _Nexus;
     FileLength = _FileLength;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Create Multicast object
 /// </summary>
 /// <param name="nexus">Nexus object so that multicasts from peers can be handled</param>
 /// <param name="read">Create in read mode</param>
 /// <param name="write">Create in write mode</param>
 public Multicast(Nexus.Nexus nexus, bool read, bool write)
 {
     _Nexus = nexus;
     if(write)
         CreateWriteMulticast();
     if(read)
         CreateReadMulticast();
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Start chess server
 /// </summary>
 /// <param name="Port">Port for server</param>
 /// <param name="Nexus">Reference to Nexus object</param>
 public ChessProtocol(int Port, Nexus.Nexus Nexus)
 {
     _ListenPort = Port;
     _Nexus = Nexus;
     new Thread(new ThreadStart(Listen)).Start();
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Sets the protocol port, and starts a new Thread with the Listen() method
 /// </summary>
 /// <param name="ProtocolPort">Port to listen to</param>
 /// <param name="PassedNexusPointer">Pointer to Nexus object</param>
 public Protocol(int ProtocolPort, Nexus.Nexus PassedNexusPointer)
 {
     _ProtocolPort = ProtocolPort;
     NexusPointer = PassedNexusPointer;
     new Thread(new ThreadStart(Listen)).Start();
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Sets the ProtocolSocket
 /// </summary>
 /// <param name="PassedSocket">The socket to handle</param>
 /// <param name="IP">IP that is handled</param>
 /// <param name="PassedNexusPointer">Pointer to the Nexus</param>
 public ProtocolHandler(Socket PassedSocket, Nexus.Nexus PassedNexusPointer, IPAddress IP)
 {
     NexusPointer = PassedNexusPointer;
     ProtocolSocket = PassedSocket;
     RemoteIP = IP;
 }