Click here to Skip to main content
15,886,919 members
Home / Discussions / C#
   

C#

 
AnswerRe: Advices for my learning path Pin
Gerry Schmitz18-Jul-23 6:03
mveGerry Schmitz18-Jul-23 6:03 
GeneralRe: Advices for my learning path Pin
coco24319-Jul-23 18:36
coco24319-Jul-23 18:36 
QuestionGoogle People API Error Pin
Kevin Marois6-Jul-23 10:54
professionalKevin Marois6-Jul-23 10:54 
AnswerRe: Google People API Error Pin
OriginalGriff6-Jul-23 18:30
mveOriginalGriff6-Jul-23 18:30 
GeneralRe: Google People API Error Pin
Kevin Marois7-Jul-23 6:26
professionalKevin Marois7-Jul-23 6:26 
GeneralRe: Google People API Error Pin
OriginalGriff7-Jul-23 6:45
mveOriginalGriff7-Jul-23 6:45 
Questionwhy the data been sent out after socket.close(), not socket.send(). Pin
viming4-Jul-23 16:06
viming4-Jul-23 16:06 
AnswerRe: why the data been sent out after socket.close(), not socket.send(). Pin
OriginalGriff4-Jul-23 18:19
mveOriginalGriff4-Jul-23 18:19 
Have you looked at this: Socket.Send Method (System.Net.Sockets) | Microsoft Learn[^]
Quote:
If you are using a connection-oriented protocol, Send will block until the requested number of bytes are sent, unless a time-out was set by using Socket.SendTimeout. If the time-out value was exceeded, the Send call will throw a SocketException. In nonblocking mode, Send may complete successfully even if it sends less than the number of bytes you request. It is your application's responsibility to keep track of the number of bytes sent and to retry the operation until the application sends the requested number of bytes. There is also no guarantee that the data you send will appear on the network immediately. To increase network efficiency, the underlying system may delay transmission until a significant amount of outgoing data is collected. A successful completion of the Send method means that the underlying system has had room to buffer your data for a network send.
You should probably read teh "Remarks" section for the Close method as well: Socket.Close Method (System.Net.Sockets) | Microsoft Learn[^]

And your code is a little odd: you check if the connection failed, explicitly report the problem, and then use the connection as if it had succeeded ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!

GeneralRe: why the data been sent out after socket.close(), not socket.send(). Pin
viming4-Jul-23 21:05
viming4-Jul-23 21:05 
GeneralRe: why the data been sent out after socket.close(), not socket.send(). Pin
OriginalGriff4-Jul-23 21:14
mveOriginalGriff4-Jul-23 21:14 
AnswerRe: why the data been sent out after socket.close(), not socket.send(). Pin
jschell5-Jul-23 5:26
jschell5-Jul-23 5:26 
QuestionProblem with string array? Pin
Member 140558794-Jul-23 6:28
Member 140558794-Jul-23 6:28 
AnswerRe: Problem with string array? Pin
Dave Kreskowiak4-Jul-23 7:06
mveDave Kreskowiak4-Jul-23 7:06 
AnswerRe: Problem with string array? Pin
OriginalGriff4-Jul-23 18:21
mveOriginalGriff4-Jul-23 18:21 
GeneralRe: Problem with string array? Pin
jschell5-Jul-23 5:28
jschell5-Jul-23 5:28 
QuestionPredicateBuilder Question Pin
Kevin Marois30-Jun-23 8:54
professionalKevin Marois30-Jun-23 8:54 
AnswerRe: PredicateBuilder Question Pin
Dave Kreskowiak1-Jul-23 4:23
mveDave Kreskowiak1-Jul-23 4:23 
GeneralRe: PredicateBuilder Question Pin
Kevin Marois1-Jul-23 8:21
professionalKevin Marois1-Jul-23 8:21 
AnswerRe: PredicateBuilder Question Pin
BillWoodruff1-Jul-23 9:54
professionalBillWoodruff1-Jul-23 9:54 
AnswerRe: PredicateBuilder Question Pin
James Curran5-Jul-23 10:41
James Curran5-Jul-23 10:41 
QuestionUnable to Receive data from Cobas e411 Serial Port Pin
Member 1493027227-Jun-23 22:20
Member 1493027227-Jun-23 22:20 
AnswerRe: Unable to Receive data from Cobas e411 Serial Port Pin
Richard MacCutchan27-Jun-23 23:08
mveRichard MacCutchan27-Jun-23 23:08 
AnswerRe: Unable to Receive data from Cobas e411 Serial Port Pin
OriginalGriff27-Jun-23 23:38
mveOriginalGriff27-Jun-23 23:38 
AnswerRe: Unable to Receive data from Cobas e411 Serial Port Pin
Ralf Meier28-Jun-23 0:43
mveRalf Meier28-Jun-23 0:43 
AnswerRe: Unable to Receive data from Cobas e411 Serial Port Pin
jschell28-Jun-23 6:08
jschell28-Jun-23 6:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.