/// <summary> /// constructor /// </summary> /// <param name="localNetbiosName"> /// a string value that specifies the local netbios name to listen at. /// </param> /// <param name="serverTransport"> /// a NetbiosServerTransport that represents the owner of listener. /// </param> /// <exception cref="ArgumentNullException"> /// thrown when localNetbiosName is null. /// </exception> /// <exception cref="ArgumentNullException"> /// thrown when serverTransport is null. /// </exception> public NetbiosServerListener(string localNetbiosName, NetbiosServerTransport serverTransport) { if (localNetbiosName == null) { throw new ArgumentNullException("localNetbiosName"); } if (serverTransport == null) { throw new ArgumentNullException("serverTransport"); } this.netbiosName = localNetbiosName; this.server = serverTransport; }
/// <summary> /// constructor /// </summary> /// <param name="localEndPoint"> /// an int value that specifies the session id of connection. /// </param> /// <param name="remoteEndPoint"> /// an int value that specifies the session id of connection. /// </param> /// <param name="server"> /// NetbiosServerTransport object that specifies the netbios server transport. /// </param> /// <param name="transport"> /// a NetbiosTransport object that specifies the owner of client. /// </param> /// <exception cref="ArgumentNullException"> /// thrown when the server is null! /// </exception> /// <exception cref="ArgumentNullException"> /// thrown when the transport is null! /// </exception> public NetbiosServerConnection( int localEndPoint, int remoteEndPoint, NetbiosServerTransport server, NetbiosTransport transport) { if (server == null) { throw new ArgumentNullException("server"); } if (transport == null) { throw new ArgumentNullException("transport"); } this.localEndPoint = localEndPoint; this.remoteEndPoint = remoteEndPoint; this.server = server; this.transport = transport; this.thread = new ThreadManager(NetbiosServerConnectionReceiveLoop, Unblock); this.buffer = new BytesBuffer(); }