本文整理汇总了C#中ConnectionManager类的典型用法代码示例。如果您正苦于以下问题:C# ConnectionManager类的具体用法?C# ConnectionManager怎么用?C# ConnectionManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ConnectionManager类属于命名空间,在下文中一共展示了ConnectionManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConnectionItem
public ConnectionItem(ConnectionManager connectionManager)
{
ArgumentVerifier.CheckObjectArgument(connectionManager, "connectionManager");
this.name = connectionManager.Name;
this.connectionManager = connectionManager;
}
示例2: newConnectionRequest
private void newConnectionRequest(ConnectionManager.ConnectionInformation connection)
{
ConnectionHandeler handeler = new ConnectionHandeler(connection);
handeler.Disconnection += serverDisconnected;
AddConnection(handeler);
handeler.Start();
}
示例3: Initialize
public void Initialize(ConnectionManager connectionManager, IServiceProvider serviceProvider)
{
this._connectionManager = connectionManager;
this._serviceProvider = serviceProvider;
ConfigureControlsFromConnectionManager();
}
示例4: CreateBatcher
/// <summary>
/// Create an instance of <see cref="IBatcher"/> according to the configuration
/// and the capabilities of the driver
/// </summary>
/// <remarks>
/// By default, .Net doesn't have any batching capabilities, drivers that does have
/// batching support need to override this method and return their own batcher.
/// </remarks>
public override IBatcher CreateBatcher(ConnectionManager connectionManager)
{
if (connectionManager.Factory.IsBatchUpdateEnabled)
return new OracleDataClientBatchingBatcher(connectionManager);
else
return new NonBatchingBatcher(connectionManager);
}
示例5: ConnectionRun
public ConnectionRun(RunData runData)
: base(runData)
{
var connectionManager = new ConnectionManager(Resolver);
_context = connectionManager.GetConnectionContext<StressConnection>();
_transportConnection = (ITransportConnection)_context.Connection;
}
示例6: ConnectionManagerTester
/// <summary>
/// Constructor. Inicializa instancias de la clase ConnectionManagerTester
/// </summary>
public ConnectionManagerTester()
{
/*
* Primero se crea el CommandManager. Este gestiona los comandos de
* sistema como alive, busy, ready, etc. Ahorra trabajo.
* Adicionalmente se suscriben los eventos (apuntador a funcion)
* para manejar las notificaciones de la clase
*/
commandManager = new CommandManager();
commandManager.Started += new CommandManagerStatusChangedEventHandler(commandManager_Started);
commandManager.Stopped += new CommandManagerStatusChangedEventHandler(commandManager_Stopped);
commandManager.CommandReceived += new CommandReceivedEventHandler(commandManager_CommandReceived);
commandManager.ResponseReceived += new ResponseReceivedEventHandler(commandManager_ResponseReceived);
/*
* Ahora se inicializa el ConnectionManager. Bajo el esquema actual
* todas las aplicaciones son servidores y es el blackboard el que
* se conecta a ellas (asi solo es necesario configurar una
* aplicacion). Se le indica nombre del modulo, puerto de conexion
* y el gestor de comandos. El modulo y puerto deben ser
* configurados en el blackboard
*/
connectionManager = new ConnectionManager("TESTER", 2000, 2000, IPAddress.Loopback, commandManager);
connectionManager.Started += new ConnectionManagerStatusChangedEventHandler(connectionManager_Started);
connectionManager.Stopped += new ConnectionManagerStatusChangedEventHandler(connectionManager_Stopped);
connectionManager.ClientDisconnected += new TcpClientDisconnectedEventHandler(connectionManager_ClientDisconnected);
connectionManager.ClientConnected += new TcpClientConnectedEventHandler(connectionManager_ClientConnected);
// Configuro el reloj
sw = new System.Diagnostics.Stopwatch();
}
示例7: SQLServerWrapper
public SQLServerWrapper(ConnectionManager cm, object txn)
{
this.cm = cm;
this.txn = txn;
this.StartSession();
}
示例8: RouterActor
public RouterActor(bool useDefault = true)
{
ConnectionMode connectionMode = ConnectionMode.ConnectionModeRemoteConnectionless;
IConnectionManager connectionManager = new ConnectionManager();
FalconConnection falconConnection = default(FalconConnection);
if (useDefault)
falconConnection = connectionManager.GetDefaultConnection();
else
falconConnection = connectionManager.GetConnection("", 1);
_connection = ConnectionObjectFactory.CreateUnlicensedConnectionObject(null);
_auto = new AutoDisposeConnectionObject(_connection);
_connection.Mode = connectionMode;
if (falconConnection.guidEdi == Guid.Empty)
throw new Exception("Operation was aborted");
DeviceOpenError err = _connection.Open2("{" + falconConnection.guidEdi.ToString() + "}",
falconConnection.Parameters);
if (err != DeviceOpenError.DeviceOpenErrorNoError)
{
throw new InvalidOperationException(string.Format("Could not open connection: {0}", err.ToString()));
}
beginConfirmedGroupDataChannel();
}
示例9: RunClientAsync
private static async Task RunClientAsync(Uri address, CancellationToken token)
{
ClientEventSource eventSource = ClientEventSource.Instance;
NetNamedPipeBinding binding = new NetNamedPipeBinding(NetNamedPipeSecurityMode.None);
binding.OpenTimeout = TimeSpan.FromSeconds(1.0d);
binding.SendTimeout = TimeSpan.FromSeconds(1.0d);
binding.ReceiveTimeout = TimeSpan.FromSeconds(1.0d);
binding.CloseTimeout = TimeSpan.FromSeconds(1.0d);
CalculatorChannelFactory factory = new CalculatorChannelFactory(binding, new EndpointAddress(address), eventSource);
await factory.OpenAsync();
ConnectionManager<ICalculatorClientAsync> connectionManager = new ConnectionManager<ICalculatorClientAsync>(factory);
using (ProxyInvoker<ICalculatorClientAsync> proxy = new ProxyInvoker<ICalculatorClientAsync>(connectionManager))
{
Random random = new Random();
while (!token.IsCancellationRequested)
{
try
{
await proxy.InvokeAsync(c => InvokeRandomAsync(random, c));
}
catch (Exception)
{
}
await Task.Delay(TimeSpan.FromMilliseconds(250.0d));
}
}
await factory.CloseAsync();
}
示例10: connect
public void connect(string args)
{
string[] javascriptArgs = JsonHelper.Deserialize<string[]>(args);
string macAddress = javascriptArgs[0];
connectionCallbackId = javascriptArgs[1];
connectionManager = new ConnectionManager();
connectionManager.Initialize(); // TODO can't we put this in the constructor?
connectionManager.ByteReceived += connectionManager_ByteReceived;
connectionManager.ConnectionSuccess += connectionManager_ConnectionSuccess;
connectionManager.ConnectionFailure += connectionManager_ConnectionFailure;
try
{
HostName deviceHostName = new HostName(macAddress);
connectionManager.Connect(deviceHostName);
}
catch (Exception ex)
{
Debug.WriteLine(ex);
connectionManager_ConnectionFailure("Invalid Hostname");
}
}
示例11: ContactRepository
public ContactRepository(ConnectionManager connectionManager)
{
connMgr = connectionManager;
//Create the Contact table if it doesn't exist
connMgr.Database.CreateEntityTable<Contact>();
}
示例12: AddDestAdapter
public override IDTSComponentMetaData100 AddDestAdapter(IDTSPipeline100 pipeline, ConnectionManager destConnMgr, out IDTSDesigntimeComponent100 destDesignTimeComp)
{
if (String.IsNullOrEmpty(quotedTableName))
{
throw new ArgumentException("Destination table name is empty");
}
IDTSComponentMetaData100 destComp = pipeline.ComponentMetaDataCollection.New();
destComp.ComponentClassID = OLEDB_DEST_GUID;
destComp.ValidateExternalMetadata = true;
destDesignTimeComp = destComp.Instantiate();
destDesignTimeComp.ProvideComponentProperties();
destComp.Name = "OleDB Destination - Sql Server";
destDesignTimeComp.SetComponentProperty("AccessMode", 0);
destDesignTimeComp.SetComponentProperty("OpenRowset", quotedTableName);
// set connection
destComp.RuntimeConnectionCollection[0].ConnectionManager = DtsConvert.GetExtendedInterface(destConnMgr);
destComp.RuntimeConnectionCollection[0].ConnectionManagerID = destConnMgr.ID;
// get metadata
destDesignTimeComp.AcquireConnections(null);
destDesignTimeComp.ReinitializeMetaData();
destDesignTimeComp.ReleaseConnections();
extCols = destComp.InputCollection[0].ExternalMetadataColumnCollection;
return destComp;
}
示例13: WinSCPWrapper
public WinSCPWrapper(ConnectionManager cm, object txn)
{
this.cm = cm;
this.txn = txn;
this.StartSession();
}
示例14: SetupListener
internal static void SetupListener(int Port)
{
SessionManagement.Init();
manager = new ConnectionManager(Port, 5, new HeartbeatParser(), false);
manager.connectionEvent += manager_connectionEvent;
}
示例15:
void IDtsConnectionManagerUI.Initialize(ConnectionManager connectionManager, IServiceProvider serviceProvider)
{
Debug.Assert((connectionManager != null) && (serviceProvider != null));
this._serviceProvider = serviceProvider;
this._connectionManager = connectionManager;
}