|
代码如下:
! 接收数据
ireceivelen=recv(isender,ClientServerMessage%buffer,500,0)
if(ireceivelen<0)then
write(*,*)"连接失败"
stop
else
dpred=ClientServerMessage%buffer
write(*,*)"sever say:"
write(*,*) dpred
write(*,*) ClientServerMessage%buffer
end if
! 发送数据
write(*,*)"please enter message:"
ClientServerMessage%bufferout=rfoutput
isendlen=send(isender,ClientServerMessage%bufferout,500,0)
write(*,*) ClientServerMessage%bufferout
if(isendlen<0)then
write(*,*)"连接失败"
end if为什么先发送数据,后接收不好使?先发送那面收不到
如果改为先接收(后面不变),再发送,再接收却又好使,那面也能收到。
|
|