N
Nurchi BECHED
Hello, my dearest respected brother, All!
I am writing a simple p2p messenger (like Net Meeting)
It is working fine except for it is not braking line properly.
The following is a block of code that receives a message
on the server:
if
((this.server!=null)&&this.server.ServerStarted&&this.server.HasConnection)
{
this.server.ReceiveMessage();
this.tbMessageIn.Text+=
this.server.Message+
" Hello world\r\n ";
}
It is only adding 'this.server.Message' and forgetting about the other part
of the string.
If I remove 'this.server.Message' it works just fine, but doesn't show the
message received
from client.
However, the following works for outgoing messages:
if ((this.server!=null)&&
this.server.ServerStarted&&
this.server.HasConnection)
if
(this.server.SendMessage(this.tbMessageOut.Text+"\r\n")==StaticVariables.OK)
{
this.statusBar1.Text="Message has been successfully sent!";
this.tbMessageOut.Text="";
}
else
this.statusBar1.Text="An error occured, message was not sent!";
But this is not a solution to my problem, why does it not work on incoming
messages.
BTW, 'this.server.Message' is a property which is defined as follows:
public string Message
{
get
{
return this.message;
}
}
Where 'return this.message' is a local (for the server class) private string
variable
Thanks you.
With best regards, Nurchi BECHED.
I am writing a simple p2p messenger (like Net Meeting)
It is working fine except for it is not braking line properly.
The following is a block of code that receives a message
on the server:
if
((this.server!=null)&&this.server.ServerStarted&&this.server.HasConnection)
{
this.server.ReceiveMessage();
this.tbMessageIn.Text+=
this.server.Message+
" Hello world\r\n ";
}
It is only adding 'this.server.Message' and forgetting about the other part
of the string.
If I remove 'this.server.Message' it works just fine, but doesn't show the
message received
from client.
However, the following works for outgoing messages:
if ((this.server!=null)&&
this.server.ServerStarted&&
this.server.HasConnection)
if
(this.server.SendMessage(this.tbMessageOut.Text+"\r\n")==StaticVariables.OK)
{
this.statusBar1.Text="Message has been successfully sent!";
this.tbMessageOut.Text="";
}
else
this.statusBar1.Text="An error occured, message was not sent!";
But this is not a solution to my problem, why does it not work on incoming
messages.
BTW, 'this.server.Message' is a property which is defined as follows:
public string Message
{
get
{
return this.message;
}
}
Where 'return this.message' is a local (for the server class) private string
variable
Thanks you.
With best regards, Nurchi BECHED.