通过TCP和确认了解socket.Send() [英] Understanding socket.Send() with TCP and confirmation

查看:100
本文介绍了通过TCP和确认了解socket.Send()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我正在尝试理解阻塞方法socket.Send()。

调用阻塞按预期进行,但这是否意味着它返回后,

底层TCP层得到确认,发送数据是由

接收到远端的套接字?我可以指望吗?我是否正确理解TCP

,它确认[在基础层面]?我不希望
期待,基于.Net的接收器在socket.Send()

终止时获得该数据!


希望我很清楚,

感谢和最好的问候,

Manfred Braun


(私人)

Lange Roetterstrasse 7

D68167曼海姆

德国


mailto:_m ************ *@manfbraun.de

(删除反垃圾邮件下划线给我发邮件!)

解决方案

当数据被写入系统缓冲区时,Send()将收到回复给你的内核用于发送的
,在接收时你将阻止直到输入的数据将是

写入你的缓冲区

HTH

Arkady


" Manfred Braun" < aa@bb.cc>写在消息

新闻:OV ************** @ tk2msftngp13.phx.gbl ...

大家好,

我试图理解阻塞方法socket.Send()。
调用阻塞按预期进行,但这是否意味着,它在底层TCP层得到确认之后返回,发送数据是通过远端的套接字接收的吗?我可以指望吗?我是否正确理解TCP
,它确认[在基础层面]?我确实没有想到,当socket.Send()
终止时,基于.Net的接收器获得了这些数据!

希望我很清楚,
感谢和致以最诚挚的问候,
Manfred Braun

(私人)
Lange Roetterstrasse 7
D68167曼海姆
德国

mailto :_m ************* @ manfbraun.de
(删除反垃圾邮件下划线给我发邮件!)



PS所以返回的字节数(来自Send())意味着在另一端真正发送或接收的数量不是

字节,而是复制的字节数

到系统缓冲区发送,所以,如果这个数字少于你试图发送给你

需要重发最后一部分

Arkady

Arkady Frenkel < AR ***** @ hotmailxdotx.com>在留言中写道

news:ex **************** @ TK2MSFTNGP14.phx.gbl ...

Send()当数据被写入系统内核缓冲区发送时,将收到回复给你的信息,接收后你会阻止直到输入的数据被写入你的缓冲区
HTH Arkady

Manfred Braun < aa@bb.cc>在消息中写道
新闻:OV ************** @ tk2msftngp13.phx.gbl ...

大家好,
调用阻塞按预期方式进行,但这是否意味着,它在底层TCP层获得确认之后返回,即发送数据收到

远程端的插座?我可以指望吗?我是否正确理解TCP
,它确认[在基础层面]?我确实没有想到,当socket.Send()
终止时,基于.Net的接收器获得了这些数据!

希望我很清楚,
感谢和致以最诚挚的问候,
Manfred Braun

(私人)
Lange Roetterstrasse 7
D68167曼海姆
德国

mailto :_m ************* @ manfbraun.de
(删除反垃圾邮件下划线给我发邮件!)




你好,


,非常感谢!


伤心!我以为我可以指望TCP的交付标准!!什么,如果底层发生了

错误?我应该通过接收方发送明确的

确认吗?我想,这只是必要的

用UDP?!


到目前为止感谢和

最好的问候,

Manfred


" Arkady Frenkel" < AR ***** @ hotmailxdotx.com>在消息中写道

news:u7 ************** @ tk2msftngp13.phx.gbl ...

P.S.因此返回的字节数(来自Send())意味着不是在另一端真正发送或接收的字节数,而是为了发送而复制到系统缓冲区的字节数
,所以如果这个数字少了比你试图发送给你
需要重发最后一部分
Arkady

" Arkady Frenkel" < AR ***** @ hotmailxdotx.com>在消息中写道
新闻:ex **************** @ TK2MSFTNGP14.phx.gbl ...

Send()将收到回复你将数据写入系统内核的缓冲区进行发送,接收时你会阻止直到输入的数据被写入你的缓冲区
HTH
Arkady

Manfred Braun < aa@bb.cc>在消息中写道
新闻:OV ************** @ tk2msftngp13.phx.gbl ...

大家好,
调用阻塞按预期方式进行,但这是否意味着,它在底层TCP层获得确认之后返回,即发送数据
远程端的套接字收到了
?我可以指望吗?我是否正确理解TCP
,它确认[在基础层面]?当$ socket.Send()
终止时,一个基于.Net的接收器得到了那个数据!

希望我很清楚,
感谢和致以最诚挚的问候,
Manfred Braun

(私人)
Lange Roetterstrasse 7
D68167曼海姆
德国

mailto :_m ************* @ manfbraun.de
(删除反垃圾邮件下划线给我发邮件!)





Hi All,

I am trying to understand the blocking method socket.Send().
The call blocks as expected, but does this mean, it returnes after the
underlying TCP layer got a confirmation, that the send data was received by
the socket on the remote end? Can I count on that? Do I understand TCP
correctly in that, it gives confirmation [on the underlying level]? I do not
expect, that a .Net based receiver got that data when socket.Send()
terminates!

Hope I was clear,
thanks and best regards,
Manfred Braun

(Private)
Lange Roetterstrasse 7
D68167 Mannheim
Germany

mailto:_m*************@manfbraun.de
(Remove the anti-spam-underscore to mail me!)

解决方案

Send() will receive back to you when data will be written to system buffers
of kernel for sending , on receive you''ll block untill incoming data will be
written into your buffer
HTH
Arkady

"Manfred Braun" <aa@bb.cc> wrote in message
news:OV**************@tk2msftngp13.phx.gbl...

Hi All,

I am trying to understand the blocking method socket.Send().
The call blocks as expected, but does this mean, it returnes after the
underlying TCP layer got a confirmation, that the send data was received
by
the socket on the remote end? Can I count on that? Do I understand TCP
correctly in that, it gives confirmation [on the underlying level]? I do
not
expect, that a .Net based receiver got that data when socket.Send()
terminates!

Hope I was clear,
thanks and best regards,
Manfred Braun

(Private)
Lange Roetterstrasse 7
D68167 Mannheim
Germany

mailto:_m*************@manfbraun.de
(Remove the anti-spam-underscore to mail me!)



P.S. So the number of bytes returned ( from Send() ) mean not number of
bytes really send or received on the other side , but number of bytes copied
to system buffer for send, so if that number less than you try to send you
need to resend the last part
Arkady
"Arkady Frenkel" <ar*****@hotmailxdotx.com> wrote in message
news:ex****************@TK2MSFTNGP14.phx.gbl...

Send() will receive back to you when data will be written to system
buffers of kernel for sending , on receive you''ll block untill incoming
data will be written into your buffer
HTH
Arkady

"Manfred Braun" <aa@bb.cc> wrote in message
news:OV**************@tk2msftngp13.phx.gbl...

Hi All,

I am trying to understand the blocking method socket.Send().
The call blocks as expected, but does this mean, it returnes after the
underlying TCP layer got a confirmation, that the send data was received
by
the socket on the remote end? Can I count on that? Do I understand TCP
correctly in that, it gives confirmation [on the underlying level]? I do
not
expect, that a .Net based receiver got that data when socket.Send()
terminates!

Hope I was clear,
thanks and best regards,
Manfred Braun

(Private)
Lange Roetterstrasse 7
D68167 Mannheim
Germany

mailto:_m*************@manfbraun.de
(Remove the anti-spam-underscore to mail me!)




Hello,

and much thanks first!

Sad! I thought I can count on the delivery garantuee of TCP!! What, if an
error occurs in the underlying layer?? Should I send an explicit
confirmation through my receiver side?? I thought, this is only necessary
with UDP?!

Thanks so far and
best regards,
Manfred

"Arkady Frenkel" <ar*****@hotmailxdotx.com> wrote in message
news:u7**************@tk2msftngp13.phx.gbl...

P.S. So the number of bytes returned ( from Send() ) mean not number of
bytes really send or received on the other side , but number of bytes copied to system buffer for send, so if that number less than you try to send you
need to resend the last part
Arkady
"Arkady Frenkel" <ar*****@hotmailxdotx.com> wrote in message
news:ex****************@TK2MSFTNGP14.phx.gbl...

Send() will receive back to you when data will be written to system
buffers of kernel for sending , on receive you''ll block untill incoming
data will be written into your buffer
HTH
Arkady

"Manfred Braun" <aa@bb.cc> wrote in message
news:OV**************@tk2msftngp13.phx.gbl...

Hi All,

I am trying to understand the blocking method socket.Send().
The call blocks as expected, but does this mean, it returnes after the
underlying TCP layer got a confirmation, that the send data was received by
the socket on the remote end? Can I count on that? Do I understand TCP
correctly in that, it gives confirmation [on the underlying level]? I do not
expect, that a .Net based receiver got that data when socket.Send()
terminates!

Hope I was clear,
thanks and best regards,
Manfred Braun

(Private)
Lange Roetterstrasse 7
D68167 Mannheim
Germany

mailto:_m*************@manfbraun.de
(Remove the anti-spam-underscore to mail me!)





这篇关于通过TCP和确认了解socket.Send()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆