/// <summary> /// Initializes all non-child-specific components. /// </summary> protected VSLSocket(SocketSettings settings, IVSLCallback callback) { this.callback = callback ?? throw new ArgumentNullException(nameof(callback)); Settings = settings ?? throw new ArgumentNullException(nameof(settings)); settings.Validate(); ThreadManager = new InvokationManager(); ExceptionHandler = new ExceptionHandler(this); FileTransfer = new FTSocket(this); connectionLostLock = new object(); callback.OnInstanceCreated(this); }
internal VSLServer(Socket socket, MemoryCache <SocketAsyncEventArgs> cache, SocketSettings settings, IVSLCallback callback) : base(settings, callback) { Channel = new NetworkChannel(socket, ExceptionHandler, cache); Manager = new NetworkManager(this, Settings.RsaKey); Handler = new PacketHandlerServer(this, Settings.LatestProductVersion, Settings.OldestProductVersion); StartReceiveLoop(); }
/// <summary> /// Creates a VSL server for the specified client and starts receiving. /// </summary> /// <param name="socket">Connected <see cref="Socket"/>.</param> /// <param name="settings">Class containing the RSA key and more settings.</param> /// <param name="callback">Inferface for event handling callbacks.</param> public VSLServer(Socket socket, SocketSettings settings, IVSLCallback callback) : this(socket, CreateFakeCache(), settings, callback) { }
/// <summary> /// Creates a VSL Client that has to be connected. /// </summary> /// <param name="settings">Class containing the RSA key and more settings.</param> /// <param name="callback">Inferface for event handling callbacks.</param> public VSLClient(SocketSettings settings, IVSLCallback callback) : base(settings, callback) { }
public FakeSocket(SocketSettings settings, IVSLCallback callback) : base(settings, callback) { Channel = new NetworkChannel(new Socket(SocketType.Stream, ProtocolType.Tcp), ExceptionHandler, CreateFakeCache()); }