TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Or Nakash
NA
10
5.6k
TCP Sockets
Aug 16 2010 5:20 PM
Hello there guys.
I made a client application in C#. Now, I have a problem when I get the data.
I want to check if it equals to something, but when I do that, I get nothing.
Here's the OnDataRecieved code;
try
{
SocketPacket theSockId = (SocketPacket)asyn.AsyncState;
int iRx = theSockId.thisSocket.EndReceive(asyn);
char[] chars = new char[iRx + 1];
System.Text.Decoder d = System.Text.Encoding.UTF8.GetDecoder();
int charLen = d.GetChars(theSockId.dataBuffer, 0, iRx, chars, 0);
System.String szData = new System.String(chars);
richTextBox1.AppendText(szData);
if(szData=="test")
{
Console.Beep();
}
WaitForData();
//msg(szData);
}
catch (ObjectDisposedException)
{
System.Diagnostics.Debugger.Log(0, "1", "\nOnDataReceived: Socket has been closed\n");
// MessageBox.Show("Problem in OnDataRecieved");
}
catch (SocketException)
{
//MessageBox.Show(se.Message);
msg("Connection dropped.");
}
Thanks in advance.
Reply
Answers (
0
)
incrementing control number value(via static property????)
Error in results of mysql routine called in c#