Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[C#]建立Socket Server時只能接受本地訊號的問題 #5

Open
CaterTsai opened this issue May 8, 2024 · 0 comments
Open

[C#]建立Socket Server時只能接受本地訊號的問題 #5

CaterTsai opened this issue May 8, 2024 · 0 comments

Comments

@CaterTsai
Copy link
Owner

CaterTsai commented May 8, 2024

【問題說明】

Socket Server在127.0.0.1的本地端可以正常運作,但是給予IP時就無法連線

【解法】

撰寫Server Side時,無論是使用Socket, TcpListener, UdpClient
初始化IPEndPoint時請都使用IPAddress.Any
部分教學有看到IPAddress.Loopback的,會導致只有使用127.0.0.1才能正常接收

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant