Changeset 1044
- Timestamp:
- 12/20/08 23:22:08 (16 years ago)
- Location:
- branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/HeuristicLab.CEDMA.Server.csproj
r988 r1044 75 75 </ItemGroup> 76 76 <ItemGroup> 77 <Compile Include="Dispatcher.cs" /> 78 <Compile Include="Server.cs" /> 77 79 <Compile Include="ServerApplication.cs" /> 78 80 <Compile Include="HeuristicLabCedmaServerPlugin.cs" /> -
branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/ServerForm.cs
r988 r1044 42 42 namespace HeuristicLab.CEDMA.Server { 43 43 public partial class ServerForm : Form { 44 private Serv iceHost host;44 private Server server; 45 45 private Store store; 46 private Dispatcher dispatcher; 47 46 48 private static readonly string rdfFile = AppDomain.CurrentDomain.BaseDirectory + "rdf_store.db3"; 47 49 private static readonly string rdfConnectionString = "sqlite:rdf:Data Source=\"" + rdfFile + "\""; 50 48 51 public ServerForm() { 49 52 InitializeComponent(); 50 // windows XP returns the external ip on index 0 while windows vista returns the external ip on index 251 if(System.Environment.OSVersion.Version.Major >= 6) {52 addressTextBox.Text = "net.tcp://" + Dns.GetHostAddresses(Dns.GetHostName())[2] + ":8002/CEDMA/World";53 } else {54 addressTextBox.Text = "net.tcp://" + Dns.GetHostAddresses(Dns.GetHostName())[0] + ":8002/CEDMA/World";55 }53 store = new Store(rdfConnectionString); 54 server = new Server(store); 55 server.Start(); 56 addressTextBox.Text = server.CedmaServiceUrl; 57 dispatcher = new Dispatcher(store); 58 dispatcher.Start(); 56 59 } 57 60 58 private void InitRunScheduler() { 59 JobManager jobManager = new JobManager(gridAddress.Text); 60 jobManager.Reset(); 61 private void refreshTimer_Tick(object sender, EventArgs e) { 62 listBox.DataSource = dispatcher.DispatchQueue; 61 63 } 62 64 63 private void InitRdfStore() { 64 store = new Store(rdfConnectionString); 65 } 66 67 private void Start() { 68 InitRdfStore(); 69 InitRunScheduler(); 70 71 host = new ServiceHost(store, new Uri(addressTextBox.Text)); 72 ServiceThrottlingBehavior throttlingBehavior = new ServiceThrottlingBehavior(); 73 throttlingBehavior.MaxConcurrentSessions = 20; 74 host.Description.Behaviors.Add(throttlingBehavior); 75 try { 76 NetTcpBinding binding = new NetTcpBinding(); 77 binding.MaxReceivedMessageSize = 100000000; // 100Mbytes 78 binding.ReaderQuotas.MaxStringContentLength = 100000000; // also 100M chars 79 binding.ReaderQuotas.MaxArrayLength = 100000000; // also 100M elements; 80 binding.Security.Mode = SecurityMode.None; 81 82 host.AddServiceEndpoint(typeof(IStore), binding, addressTextBox.Text); 83 host.Open(); 84 } catch(CommunicationException ex) { 85 MessageBox.Show("An exception occurred: " + ex.Message); 86 host.Abort(); 87 } 88 } 89 90 private void startButton_Click(object sender, EventArgs e) { 91 Start(); 92 startButton.Enabled = false; 65 private void connectButton_Click(object sender, EventArgs e) { 66 // new GridExecutor(dispatcher) 93 67 } 94 68 } -
branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/ServerForm.designer.cs
r1003 r1044 45 45 /// </summary> 46 46 private void InitializeComponent() { 47 this.components = new System.ComponentModel.Container(); 47 48 this.addressTextBox = new System.Windows.Forms.TextBox(); 48 49 this.externalAddressLabel = new System.Windows.Forms.Label(); 49 50 this.gridAddressLabel = new System.Windows.Forms.Label(); 50 51 this.gridAddress = new System.Windows.Forms.TextBox(); 51 this.startButton = new System.Windows.Forms.Button(); 52 this.connectButton = new System.Windows.Forms.Button(); 53 this.listBox = new System.Windows.Forms.ListBox(); 54 this.refreshTimer = new System.Windows.Forms.Timer(this.components); 52 55 this.SuspendLayout(); 53 56 // … … 82 85 this.gridAddress.Location = new System.Drawing.Point(106, 32); 83 86 this.gridAddress.Name = "gridAddress"; 84 this.gridAddress.Size = new System.Drawing.Size( 229, 20);87 this.gridAddress.Size = new System.Drawing.Size(160, 20); 85 88 this.gridAddress.TabIndex = 8; 86 89 // 87 // startButton90 // connectButton 88 91 // 89 this.startButton.Location = new System.Drawing.Point(15, 84); 90 this.startButton.Name = "startButton"; 91 this.startButton.Size = new System.Drawing.Size(75, 23); 92 this.startButton.TabIndex = 10; 93 this.startButton.Text = "Start"; 94 this.startButton.UseVisualStyleBackColor = true; 95 this.startButton.Click += new System.EventHandler(this.startButton_Click); 92 this.connectButton.Location = new System.Drawing.Point(272, 30); 93 this.connectButton.Name = "connectButton"; 94 this.connectButton.Size = new System.Drawing.Size(75, 23); 95 this.connectButton.TabIndex = 10; 96 this.connectButton.Text = "Connect"; 97 this.connectButton.UseVisualStyleBackColor = true; 98 this.connectButton.Click += new System.EventHandler(this.connectButton_Click); 99 // 100 // listBox 101 // 102 this.listBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 103 | System.Windows.Forms.AnchorStyles.Left) 104 | System.Windows.Forms.AnchorStyles.Right))); 105 this.listBox.FormattingEnabled = true; 106 this.listBox.Location = new System.Drawing.Point(12, 58); 107 this.listBox.Name = "listBox"; 108 this.listBox.Size = new System.Drawing.Size(350, 277); 109 this.listBox.TabIndex = 11; 110 // 111 // refreshTimer 112 // 113 this.refreshTimer.Enabled = true; 114 this.refreshTimer.Interval = 1000; 115 this.refreshTimer.Tick += new System.EventHandler(this.refreshTimer_Tick); 96 116 // 97 117 // ServerForm … … 99 119 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 100 120 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 101 this.ClientSize = new System.Drawing.Size(347, 119); 102 this.Controls.Add(this.startButton); 121 this.ClientSize = new System.Drawing.Size(374, 342); 122 this.Controls.Add(this.listBox); 123 this.Controls.Add(this.connectButton); 103 124 this.Controls.Add(this.gridAddressLabel); 104 125 this.Controls.Add(this.gridAddress); … … 118 139 private System.Windows.Forms.Label gridAddressLabel; 119 140 private System.Windows.Forms.TextBox gridAddress; 120 private System.Windows.Forms.Button startButton; 141 private System.Windows.Forms.Button connectButton; 142 private System.Windows.Forms.ListBox listBox; 143 private System.Windows.Forms.Timer refreshTimer; 121 144 } 122 145 } -
branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/ServerForm.resx
r378 r1044 118 118 <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 119 119 </resheader> 120 <metadata name="refreshTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 121 <value>17, 17</value> 122 </metadata> 120 123 </root>
Note: See TracChangeset
for help on using the changeset viewer.