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
kennedy chozo
NA
7
32.9k
C# ReadSocket Function
Nov 13 2013 2:40 AM
Hello, I just want to know how every single line of code actually does.
Codes :
1 private String SocketRead(Socket socket) {
2 StringBuilder result = new StringBuilder();
3 byte []buffer = new byte[1];
4 while( socket.Receive(buffer)>0 ) {
5 char ch = (char)buffer[0];
6 if( ch=='\n') break;
7 if( ch!='\r') result.Append(ch);
8 }
9 return result.ToString();
10 }
I don't understand line 3,4 and 5. What does byte[1] means ?
Reply
Answers (
3
)
Project assistance ?
to add empty xmlns to nodes