由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - Asking for help on TCP server programming
相关主题
紧急求助!a question about inetd server programming
网络编程如何进行错误处理an unixquestions, Please help!
who knows how to use nslookup?[转载] tcp connect RST??
求救: 我的EXCEED怎么不工作了? 有办法解决么?Help about printing through network!
xhost problem....osx 10.4 10.5 连smb 问题
能不能推荐几本学习初级 Socket (Server/Client) 的书?谢谢MPI问题求助。Help! (转载)
Re: 能不能推荐几本学习初级 Socket (Server/Client) 的书?谢谢finger: "connect: Connection refused"
Unix 编成小问题Help About Font Server
相关话题的讨论汇总
话题: server话题: connection话题: tcp话题: asking话题: what
进入Unix版参与讨论
1 (共1页)
I**********s
发帖数: 441
1
Generally server recvs sth, then sends response,
and closes the connection. However sometimes it
requires the server to wait passively for the
client to shut down the connection, otherwise
server keeps connection open and waits for
client's next request. If so, what's the answer
for 1) and 2)?
Or is it that each time a new request opens a
new connection? If so, what's the answer for 2)?
1) What's the mechanism to indicate to the server
if the client has shut down connection or not?
2) And what's
w***s
发帖数: 21
2

It seems that you know nothing about socket programming.
ok, normally your program will block on command 'recv' or 'recvfrom'
so, to question 1, when the client close the connection. the recv will return
0.to question 2, when data is available on socket, recv will return with the
data length and the content of the data just received.

【在 I**********s 的大作中提到】
: Generally server recvs sth, then sends response,
: and closes the connection. However sometimes it
: requires the server to wait passively for the
: client to shut down the connection, otherwise
: server keeps connection open and waits for
: client's next request. If so, what's the answer
: for 1) and 2)?
: Or is it that each time a new request opens a
: new connection? If so, what's the answer for 2)?
: 1) What's the mechanism to indicate to the server

1 (共1页)
进入Unix版参与讨论
相关主题
Help About Font Serverxhost problem....
getting connected to Oracle in Perl能不能推荐几本学习初级 Socket (Server/Client) 的书?谢谢
How to send packet on a chosen interface?THX!Re: 能不能推荐几本学习初级 Socket (Server/Client) 的书?谢谢
a socket questionUnix 编成小问题
紧急求助!a question about inetd server programming
网络编程如何进行错误处理an unixquestions, Please help!
who knows how to use nslookup?[转载] tcp connect RST??
求救: 我的EXCEED怎么不工作了? 有办法解决么?Help about printing through network!
相关话题的讨论汇总
话题: server话题: connection话题: tcp话题: asking话题: what