本文整理汇总了C#中ConnectionManager类的典型用法代码示例。如果您正苦于以下问题:C# ConnectionManager类的具体用法?C# ConnectionManager怎么用?C# ConnectionManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ConnectionManager类属于命名空间,在下文中一共展示了ConnectionManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ConnectionItem
public ConnectionItem(ConnectionManager connectionManager)
{
ArgumentVerifier.CheckObjectArgument(connectionManager, "connectionManager");
this.name = connectionManager.Name;
this.connectionManager = connectionManager;
}
开发者ID:japj,项目名称:sqlsrvintegrationsrv,代码行数:7,代码来源:DelimitedFileReaderComponentUI.cs
示例2: newConnectionRequest
private void newConnectionRequest(ConnectionManager.ConnectionInformation connection)
{
ConnectionHandeler handeler = new ConnectionHandeler(connection);
handeler.Disconnection += serverDisconnected;
AddConnection(handeler);
handeler.Start();
}
开发者ID:rodero95,项目名称:butterfly-dev,代码行数:7,代码来源:LicenseRequester.cs
示例3: Initialize
public void Initialize(ConnectionManager connectionManager, IServiceProvider serviceProvider)
{
this._connectionManager = connectionManager;
this._serviceProvider = serviceProvider;
ConfigureControlsFromConnectionManager();
}
开发者ID:nkuebler000,项目名称:SSIS_SSH_Components,代码行数:7,代码来源:SSHConnectionManagerUIForm.cs
示例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);
}
开发者ID:Novthirteen,项目名称:sconit_timesseiko,代码行数:15,代码来源:OracleDataClientDriver.cs
示例5: ConnectionRun
public ConnectionRun(RunData runData)
: base(runData)
{
var connectionManager = new ConnectionManager(Resolver);
_context = connectionManager.GetConnectionContext<StressConnection>();
_transportConnection = (ITransportConnection)_context.Connection;
}
开发者ID:Choulla-Naresh8264,项目名称:SignalR,代码行数:7,代码来源:ConnectionRun.cs
示例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();
}
开发者ID:BioRoboticsUNAM,项目名称:Robotics,代码行数:34,代码来源:ConnectionManagerTester.cs
示例7: SQLServerWrapper
public SQLServerWrapper(ConnectionManager cm, object txn)
{
this.cm = cm;
this.txn = txn;
this.StartSession();
}
开发者ID:BartekR,项目名称:ssis-winscptask,代码行数:7,代码来源:SQLServerWrapper.cs
示例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();
}
开发者ID:danielwerthen,项目名称:Funcis-Sharp,代码行数:25,代码来源:RouterActor.cs
示例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();
}
开发者ID:knightfall,项目名称:writeasync,代码行数:35,代码来源:Program.cs
示例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");
}
}
开发者ID:RP-Z,项目名称:BluetoothSerial,代码行数:25,代码来源:BluetoothSerial.cs
示例11: ContactRepository
public ContactRepository(ConnectionManager connectionManager)
{
connMgr = connectionManager;
//Create the Contact table if it doesn't exist
connMgr.Database.CreateEntityTable<Contact>();
}
开发者ID:nicolehaugen79,项目名称:BusinessContactManager,代码行数:7,代码来源:ContactRepository.cs
示例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;
}
开发者ID:japj,项目名称:sqlsrvintegrationsrv,代码行数:28,代码来源:SQL.cs
示例13: WinSCPWrapper
public WinSCPWrapper(ConnectionManager cm, object txn)
{
this.cm = cm;
this.txn = txn;
this.StartSession();
}
开发者ID:BartekR,项目名称:ssis-winscptask,代码行数:7,代码来源:WinSCPWrapper.cs
示例14: SetupListener
internal static void SetupListener(int Port)
{
SessionManagement.Init();
manager = new ConnectionManager(Port, 5, new HeartbeatParser(), false);
manager.connectionEvent += manager_connectionEvent;
}
开发者ID:BjkGkh,项目名称:R106,代码行数:7,代码来源:Socket.cs
示例15:
void IDtsConnectionManagerUI.Initialize(ConnectionManager connectionManager, IServiceProvider serviceProvider)
{
Debug.Assert((connectionManager != null) && (serviceProvider != null));
this._serviceProvider = serviceProvider;
this._connectionManager = connectionManager;
}
开发者ID:japj,项目名称:sqlsrvintegrationsrv,代码行数:7,代码来源:CredentialConnectionManagerUI.cs
示例16: AppManager
public AppManager(ConnectionManager connectionManager,
IDeviceInfo deviceInfo,
AccountManager accountManager) : base(connectionManager)
{
_deviceInfo = deviceInfo;
_accountManager = accountManager;
}
开发者ID:jorik041,项目名称:CrossChat,代码行数:7,代码来源:AppManager.cs
示例17: Setup
// Setup function
public void Setup()
{
_transport = new SerialTransport {CurrentSerialSettings = {DtrEnable = false}};
// some boards (e.g. Sparkfun Pro Micro) DtrEnable may need to be true.
// We do not need to set serial port and baud rate: it will be found by the connection manager
// Initialize the command messenger with the Serial Port transport layer
// Set if it is communicating with a 16- or 32-bit Arduino board
_cmdMessenger = new CmdMessenger(_transport, BoardType.Bit16)
{
PrintLfCr = false // Do not print newLine at end of command, to reduce data being sent
};
// The Connection manager is capable or storing connection settings, in order to reconnect more quickly
// the next time the application is run. You can determine yourself where and how to store the settings
// by supplying a class, that implements ISerialConnectionStorer. For convenience, CmdMessenger provides
// simple binary file storage functionality
var serialConnectionStorer = new SerialConnectionStorer("SerialConnectionManagerSettings.cfg");
// We don't need to provide a handler for the Identify command - this is a job for Connection Manager.
_connectionManager = new SerialConnectionManager(
_transport as SerialTransport,
_cmdMessenger,
(int) Command.Identify,
CommunicationIdentifier,
serialConnectionStorer)
{
// Enable watchdog functionality.
WatchdogEnabled = true,
// Instead of scanning for the connected port, you can disable scanning and only try the port set in CurrentSerialSettings
//DeviceScanEnabled = false
};
// Show all connection progress on command line
_connectionManager.Progress += (sender, eventArgs) =>
{
// If you want to reduce verbosity, you can only show events of level <=2 or ==1
if (eventArgs.Level <= 3) Console.WriteLine(eventArgs.Description);
};
// If connection found, tell the arduino to turn the (internal) led on
_connectionManager.ConnectionFound += (sender, eventArgs) =>
{
// Create command
var command = new SendCommand((int)Command.TurnLedOn);
// Send command
_cmdMessenger.SendCommand(command);
};
//You can also do something when the connection is lost
_connectionManager.ConnectionTimeout += (sender, eventArgs) =>
{
//Do something
};
// Finally - activate connection manager
_connectionManager.StartConnectionManager();
}
开发者ID:DiLRandI,项目名称:Arduino-CmdMessenger,代码行数:60,代码来源:SimpleWatchdog.cs
示例18: ShouldLeaveOpenConnectionOpen
public void ShouldLeaveOpenConnectionOpen()
{
DbConnection connection = Substitute.For<DbConnection>();
connection.State.Returns(ConnectionState.Open);
ConnectionManager manager = new ConnectionManager(connection);
manager.Dispose();
connection.Received(0).Close();
}
开发者ID:luiseduardohdbackup,项目名称:TestMvcApplication,代码行数:8,代码来源:ConnectionManagerTester.cs
示例19: ConnectionHandeling
public ConnectionHandeling(int port, int maxConnections, int connectionsPerIP, bool enabeNagles)
{
this.liveConnections = new Hashtable(maxConnections);
this.manager = new ConnectionManager(port, maxConnections, new InitialPacketParser(), !enabeNagles);
//this.manager = new SocketManager();
//int portID, int maxConnections, int connectionsPerIP, IDataParser parser, bool disableNaglesAlgorithm)
//this.manager.init(port, maxConnections, connectionsPerIP, new InitialPacketParser(), !enabeNagles);
}
开发者ID:BjkGkh,项目名称:R106,代码行数:8,代码来源:ConnectionHandeling.cs
示例20: BuildManager
internal BuildManager(GlobalManager globalManager)
{
_globalManager = globalManager;
_connectionManager = new ConnectionManager(globalManager);
_colorManager = new ColorManager(globalManager);
_sizeManager = new SizeManager(globalManager);
_jsonTreeManager = new JsonTreeManager(globalManager);
}
开发者ID:gustafsonk,项目名称:TFS-Treemap,代码行数:8,代码来源:BuildManager.cs
注:本文中的ConnectionManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论