/// <summary> /// Initializes a new instance of this class. /// </summary> /// <param name="hostName"> /// The server hosting the acquirer. /// </param> /// <param name="localInterface"> /// The ip address of the local interface to listen. /// </param> public Engine() { try { _forwarder = new MyBridge(); _sequencer = new VolatileStanSequencer(); // Create a server to listen internal clients requests (internal clients are clients that connect //from viacard itself e.g loading, settlement, reversal. etc.). TcpListener inlistener = new TcpListener(PinConfigurationManager.FepConfig.InternalServerPort); inlistener.LocalInterface = PinConfigurationManager.FepConfig.BridgeHostIp; _forwarder.InternalServer = new Trx.Messaging.FlowControl.Server("InternalServer", inlistener, new BasicServerPeerManager()); // Create a server to listen external clients requests (external clients are the node connections). TcpListener exlistener = new TcpListener(PinConfigurationManager.FepConfig.ExternalServerPort); exlistener.LocalInterface = PinConfigurationManager.FepConfig.BridgeHostIp; _forwarder.ExternalServer = new Trx.Messaging.FlowControl.Server("ExternalServer", exlistener, new BasicServerPeerManager2()); // Configure the internal server to accept up to 4 clients (i.e 4 connections from ViaCard at a time). //_forwarder.InternalServer.Listener.ChannelPool = new BasicChannelPool( // new TwoBytesNboHeaderChannel(new Iso8583Ascii1987BinaryBitmapMessageFormatter()), // 1000); //_forwarder.ExternalServer.Listener.ChannelPool = new BasicChannelPool( // new TwoBytesNboHeaderChannel(new Iso8583Ascii1987BinaryBitmapMessageFormatter()), // 1000); _forwarder.InternalServer.Listener.ChannelPool = new BasicChannelPool( new TwoBytesNboHeaderChannel(new Iso8583Ascii1987BinaryBitmapMessageFormatter()), 1000); _forwarder.ExternalServer.Listener.ChannelPool = new BasicChannelPool( new TwoBytesNboHeaderChannel(new Iso8583Ascii1987BinaryBitmapMessageFormatter()), 1000); // Instruct the server peer manager to deliver all the received // messages (from all its peers) to the forwarder. _forwarder.InternalServer.PeerManager.MessageProcessor = new InternalServerProcessor(_forwarder); _forwarder.ExternalServer.PeerManager.MessageProcessor = new ExternalServerProcessor(_forwarder); } catch (Exception ex) { new PANE.ERRORLOG.Error().LogToFile(ex); } }
/// <summary> /// Initializes a new instance of this class. /// </summary> public InternalServerProcessor(MyBridge theBridge) { this._theBridge = theBridge; this._timeout = PinConfigurationManager.FepConfig.RequestTimeout; }
public void PromptAndRequestAction() { MyBridge.Prompt("Select Blockers."); SelectAction(MyBridge.SelectActionFromList(GetActions())); }
public void PromptAndRequestAction() { MyBridge.Prompt("Select target " + MyActivatable.MyTargeting.Targeted.Count.ToString() + " of " + MyActivatable.MyTargeting.MaxTargets + " " + MyActivatable.MyTargeting.Description); SelectAction(MyBridge.SelectActionFromList(GetActions())); }
public void PromptAndRequestAction() { MyBridge.Prompt("Perform \"" + MyActivatable.MyCost.ActionParts[ActionPartIndex].ToString(MyGame) + "\"?"); SelectAction(MyBridge.SelectActionFromList(GetActions())); }
public override void Enter() { MyBridge.Prompt("You have priority."); SelectAction(MyBridge.SelectActionFromList(GetActions())); }
public override void Enter() { MyBridge.Prompt("Waiting for opponents."); }
public void PromptAndRequestAction() { MyBridge.Prompt("Pay \"" + Utilities.ColorListToShortenedString(MyActivatable.MyCost.GetUnpaidMana().Select(x => { return(x.Color); })) + "\"?"); SelectAction(MyBridge.SelectActionFromList(GetActions())); }