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
Aaditya Bhardwaj
NA
57
364
I want to receive data from a gps device and want to show t
Apr 28 2019 7:13 AM
my code is :
void ReceivedByServer()
{
Socket socketReceive = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
int portReceive = 90;
IPEndPoint iPEndPointReceive = new IPEndPoint(IPAddress.Parse("0.0.0.0"), portReceive);
socketReceive.Bind(iPEndPointReceive);
socketReceive.Listen(10);
ServicePointManager.SecurityProtocol=SecurityProtocolType.Tls12;
while (true)
{
Socket temp = null;
try
{
temp = socketReceive.Accept();
byte[] messageReceivedByServer = new byte[1000];
int sizeOfReceivedMessage = temp.Receive(messageReceivedByServer, 0, messageReceivedByServer.Length, SocketFlags.None);
string str = Encoding.UTF8.GetString(messageReceivedByServer);
labelShow.Text += "\r\nClient: " + str;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message + "\n" + ex.StackTrace + "\n" + ex.HelpLink + "\n" + ex.InnerException
+ "\n" + ex.Source + "\n" + ex.TargetSite);
}
}
}
I am getting response from gps device but the message is not shown in string format
i got the output like
Reply
Answers (
1
)
String of the expression I defined from object type
How to update data in a listbox from another form?