誰かが私の問題を解決してくれることを願っています。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
}
私の問題 : -最初のクライアントを試してみると、すべて問題なく、2 つの接続が正常に行われました。- 2 番目のクライアントを試すと、最初の接続は問題ありませんが、2 番目のクライアントでは BIND エラーが発生します !! -何が問題なのかよくわかりません。-助けてくれてありがとう。