|
Ajithevn wrote: Client-A connects to server with IP address specified in the socket as "Client-B(168.132.2.5)" and recieve a message from Client-A as soon as the message is recieved i need to send that message to Client-B. how is that possible?
I don't understand this - how can Client-A receive a message from Client-A?
However, to restate, each client connects to a server and sends and receives messages. The address of the server must be specified by the client when it opens the connection. If the client needs to communicate with more than one server then it needs a socket connection for each one.
|
|
|
|
|
Richard MacCutchan wrote: I don't understand this - how can Client-A receive a message from Client-A?
im sorry i did not explain it properly its not that "Client-A receive a message from Client-A" Client-A sends a msg to a different machine which contains a server and Client-B(168.132.2.5). so when the server recieve the msg how to send that msg to Client-B
Richard MacCutchan wrote: If the client needs to communicate with more than one server then it needs a socket connection for each one.
here client is not communicating with more than one server it is multiple clients communicating with one server.
where clients are on different machines.
one machine contains both client as well a server(Client-B,Server).
one machine contains only client(Client-A).
Client-A--->Server--->Client-B
modified on Tuesday, October 20, 2009 7:15 AM
|
|
|
|
|
Ajithevn wrote: Client-A--->Server--->Client-B
Thanks, that makes it clearer now.
- The server will need some method of storing messages received from Client-A.
- When Client-B makes a connection it should send the server a message saying "give me any stored messages".
- The server will respond with the messages from Client-A, and so on.
Does that make sense?
|
|
|
|
|
|
Just because you called tcpListener.AcceptSocket() once doesn't mean that you can't call it again. You can have as many sockets connected to your server at the same time as you want.
All you need is some better plumbing in your server to do multiple things at once: listen for clients that are trying to connect, listen to clients that have already connected for data and send received data to other connected clients. You can do this with some proper multi-threading and synchronous methods like you're doing now, but if you have the time and the drive to learn something new then using asynchronous methods would probably provide a cleaner, more elegant solution.
MSDN has a decent example of how to listen for new clients asynchronously here: TcpListener.BeginAcceptSocket[^] and TcpListnener.BeginAcceptTcpClient[^]
To continue with the async theme, the TcpClient class also has async methods to handle sending and receiving data. Examples of those are on MSDN as well.
Of course, this may be overkill depending on what you need . . .
|
|
|
|
|
I am trying to make many SOAP calls to the same SOAP service on different servers (different IP addresses) - each call made with a different thread and a different instance of the SOAP service.
It only seems to work properly (correct response from the server) when I have a small # of instances (< ~10). If I have more than about 10, I don't get a response (timeout) from the servers.
Is there something inherently single-threaded about SOAP? Even though I'm creating separate instances for each thread, are they interfering with each other?
C# 3.0 VS2008
Thanks in advance for any insight to this problem...
Garry
|
|
|
|
|
You have multiple web services and a single client or multiple client and a single web service?
WCF has several connection limits, that you can modify through configuration, look here. It is likely you are hitting the maxConcurrentSessions limit of 10.
|
|
|
|
|
I am the client. There are one or more servers on my subnet, running a SOAP service written by someone else, that I have no control of.
I am attempting to discover these servers on my subnet by making a SOAP call to each possible IP address. 95% of them will fail/timeout since there is no actual machine at that address. I am looking for the SOAP calls that succeed to determine which IP addresses are valid systems that are running the SOAP service in question.
It looks like the configuration parameters you pointed out are for the server. That is not an issue for me.
|
|
|
|
|
How are you starting the threads? With Thread.Start or using ThreadPool?
|
|
|
|
|
I'm using a simple ThreadPool. Is that the problem?
|
|
|
|
|
It shouldn't, the thread limit for a thread pool is well over 10 threads.
What kind of timeout exception are you getting? It seems to come from you client or from the remote service?
Are you really sure you are calling a different server in each thread? Could it be possible that your code has some bug that causes it to call always the same server?
|
|
|
|
|
Hi friends,
I am new for vidoes upload and display.now am using the following code.
<object id="player" classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" height="170"
width="300">
<param name="url" value="~/Videos/AkshayZaraJhoom.mp3"/>
<param name="showcontrols" value="true" />
<param name="autostart" value="false" />
</object>
Media player is displaying in browser.but after clickting the play button its not working well.
what is the use is classid in video display?
|
|
|
|
|
Notice how this is the C# forum and your question is not about C# in any way ? Try the ASP.NET forum.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi all,
I have a Grid view on my page and I need it displayed on Page Load with only the column names. I then need to save data into the Grid view with values for the textboxes after clicking ADD button.
This is what I have but it doesn't do what I want to it to do.
Page_Load:
protected void Page_Load(object sender, EventArgs e)
{
DataTable dt = new DataTable();
this.dgInfoProfile.DataSource = dt;
dgInfoProfile.DataBind();
}
ADD button:
protected void brtAdd_Click(object sender, EventArgs e)
{
try
{
////DataTable dt = new DataTable();
DataRow dr = dt.NewRow();
dr["Full Names"] = txtFirstName3.Text;
dr["Identifying Number"] = txtIdentityNo.Text;
dr["Passport Number"] = txtPassportNo.Text;
dt.Rows.Add(dr);
////Bind GridView Here with this Table
this.dgInfoProfile.DataSource = dt;
dgInfoProfile.DataBind();
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
}
if you have any idea on how to get this done, I'd really appreciate your advise.
Thanks.
|
|
|
|
|
Better suited in the ASP.NET forum.
|
|
|
|
|
I checked the ASP.Net forum first and find that someone has asked the same question and was told that it's not the right forum for such question.
I tried searching on the net but couldn't find how exactly to do it they want I want to.
I really need some help.
|
|
|
|
|
Nopo wrote: but it doesn't do what I want to it to do.
What are you getting after clicking ADD button.
Is this ASP.Net application or Windows application?
|
|
|
|
|
I get this error: "Column ‘Full Names’ does not belong to table". I'm using ASP.Net application.
|
|
|
|
|
Nopo wrote: I'm using ASP.Net application.
Then you should have posted this on ASP.Net forum.
The guy you are talking about, is developing his application in windows forms thats why he is asked to post in windows form.
BTW, Are you definning protype of your DataTable?
Can i see that code?
|
|
|
|
|
Here is my code:
Page_Load:
protected void Page_Load(object sender, EventArgs e)
{
DataTable dt = new DataTable();
this.dgInfoProfile.DataSource = dt;
dgInfoProfile.DataBind();
}
ADD button:
protected void brtAdd_Click(object sender, EventArgs e)
{
try
{
////DataTable dt = new DataTable();
DataRow dr = dt.NewRow();
dr["Full Names"] = txtFirstName3.Text;
dr["Identifying Number"] = txtIdentityNo.Text;
dr["Passport Number"] = txtPassportNo.Text;
dt.Rows.Add(dr);
////Bind GridView Here with this Table
this.dgInfoProfile.DataSource = dt;
dgInfoProfile.DataBind();
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
}
|
|
|
|
|
Where are you definning columns of DataTable?
|
|
|
|
|
"Page_Load" and "Response.Write" -> are ASP.NET.
First : Create your column first, you cannot write to a column, that doesn't exists.
DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn("Full Names"));
dt.Columns.Add(new DataColumn("Identifying Number"));
dt.Columns.Add(new DataColumn("Passport Number"));
this.dgInfoProfile.DataSource = dt;
dgInfoProfile.DataBind();
|
|
|
|
|
This is what i am asking for, have you done this?
|
|
|
|
|
I've created the header columns in my design like this:
<asp:gridview id="dgInfoProfile" runat="server">
<columns>
<asp:boundfield headertext="Full Names">
<asp:boundfield headertext="Identifying Number">
<asp:boundfield headertext="Passort Number">
Didn't know that I have to define the columns in the code behind again.
|
|
|
|
|
That's why, ask in ASP.NET forum, because what you've done is working in WinForm.
|
|
|
|