【发布时间】:2013-06-06 13:06:31
【问题描述】:
我希望有人可以帮助我解决我的问题。 我尝试使用 C 制作客户端/服务器 FTP 应用程序,
我的程序实现是这样的:
main()
{
1)create socket
2)bind on port 8888
3)listen
5) while(accept)
{
5) create pthread1 to handle the connection using function1
6)join the pthread1
}
}
function 1()
{
1)take the file descriptor from the main
2) discusses with client using the descriptor (send/recv)
3) create pthread2 to handle data exchange
4) join the pthread 2
5)free the descriptor
}
function 2()
{
1)create socket
2)bind on port 8889
3)listen
4)accept
}
我的问题: -当我尝试第一个客户端时,一切正常,两个连接都做得很好! -当我尝试第二个客户端时,第一个连接正常,但第二个出现 BIND 错误! -我真的不知道有什么问题。 -谢谢你的帮助。
【问题讨论】: