A
Alex. O. Koranteng
I have a windows form on my windows client application. The event handler for
the button will read the contents of a text file. I am getting the error
below. The servicehost is running okay.
{"The open operation did not complete within the allotted timeout of
00:01:00. The time allotted to this operation may have been a portion of a
longer timeout."}
Below is the code for the button. I need some suggestions and help.
namespace WCFClientApp
{
public partial class Form1 : Form
{
private int _Selection;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
switch (_Selection)
{
case 0:
TCP.ServiceClassClient client = new
WCFClientApp.TCP.ServiceClassClient("NetTcpBinding_IServiceClass");
textBox1.Text = client.GetText();
break;
case 1:
NamedPipe.ServiceClassClient client1 = new
WCFClientApp.NamedPipe.ServiceClassClient("NetNamedPipeBinding_IServiceClass");
textBox1.Text = client1.GetText();
break;
case 2:
break;
}
}
private void button2_Click(object sender, EventArgs e)
{
switch (_Selection)
{
case 0:
TCP.ServiceClassClient client = new
WCFClientApp.TCP.ServiceClassClient("NetTcpBinding_IServiceClass");
textBox2.Text = client.MultiplyNumbers(5, 5).ToString();
break;
case 1:
NamedPipe.ServiceClassClient client1 = new
WCFClientApp.NamedPipe.ServiceClassClient("NetNamedPipeBinding_IServiceClass");
textBox2.Text = client1.MultiplyNumbers(5, 5).ToString();
break;
case 2:
break;
}
}
private void radioButton1_CheckedChanged(object sender, EventArgs e)
{
_Selection = 0;
textBox2.Text = "";
textBox1.Text = "";
}
private void radioButton2_CheckedChanged(object sender, EventArgs e)
{
_Selection = 1;
textBox2.Text = "";
textBox1.Text = "";
}
}
}
the button will read the contents of a text file. I am getting the error
below. The servicehost is running okay.
{"The open operation did not complete within the allotted timeout of
00:01:00. The time allotted to this operation may have been a portion of a
longer timeout."}
Below is the code for the button. I need some suggestions and help.
namespace WCFClientApp
{
public partial class Form1 : Form
{
private int _Selection;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
switch (_Selection)
{
case 0:
TCP.ServiceClassClient client = new
WCFClientApp.TCP.ServiceClassClient("NetTcpBinding_IServiceClass");
textBox1.Text = client.GetText();
break;
case 1:
NamedPipe.ServiceClassClient client1 = new
WCFClientApp.NamedPipe.ServiceClassClient("NetNamedPipeBinding_IServiceClass");
textBox1.Text = client1.GetText();
break;
case 2:
break;
}
}
private void button2_Click(object sender, EventArgs e)
{
switch (_Selection)
{
case 0:
TCP.ServiceClassClient client = new
WCFClientApp.TCP.ServiceClassClient("NetTcpBinding_IServiceClass");
textBox2.Text = client.MultiplyNumbers(5, 5).ToString();
break;
case 1:
NamedPipe.ServiceClassClient client1 = new
WCFClientApp.NamedPipe.ServiceClassClient("NetNamedPipeBinding_IServiceClass");
textBox2.Text = client1.MultiplyNumbers(5, 5).ToString();
break;
case 2:
break;
}
}
private void radioButton1_CheckedChanged(object sender, EventArgs e)
{
_Selection = 0;
textBox2.Text = "";
textBox1.Text = "";
}
private void radioButton2_CheckedChanged(object sender, EventArgs e)
{
_Selection = 1;
textBox2.Text = "";
textBox1.Text = "";
}
}
}