互联网上的套接字连接问题 [英] Socket connection problems over internet

查看:121
本文介绍了互联网上的套接字连接问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!
我使用C#中的套接字类编写了一个程序,它是一个聊天程序.在LAN网络中我可以使用它,但是在Internet上我不能使用它.
你可以引导我吗?

Hi!
I made a program using the socket class in C# which is a chat program. In LAN network I can work with it, but over the internet I can''t.
Can you guide me?

Thanks in advance!

推荐答案

首先,使用此链接检查您的应用程序是否已连接到互联网. a> [< ^ ]放置您的列表端口号,然后单击检查按钮..

如果失败,则可能是您在127.0.0.1(localhost)或您的LAN地址(如192.168.0.10)上的listnig
因此,请将您的列表界面地址更改为此链接 [ ^ ].
那就是您计算机的全局IP(Internet上的IP).

如果仍然无法正常工作,请发表评论,然后提供更好的答案....
First of all check whether your app is connected to internet using this link.. can you see me[^] put your listing port no and hit check button..

If it failed probably you are listnig on 127.0.0.1(localhost) or your LAN address (like 192.168.0.10)
so change your listing interface address to IP shown on this link[^].
that is you computer''s global IP (IP on internet).

If still not working then comment, I come with improved answer ....


我首先想到的是:看到问题时,服务器和客户端之间是否存在防火墙? (如果是P2P的话-在同级之间)?

因此,请检查防火墙设置-首先,它可以是协议和端口号的组合.
First that comes to my mind is: is there a firewall between the server and the clients when you see the problem (if this is P2P -- between the peers)?

So, check up your firewall settings -- first of all, it can be a combination of protocol and port number.


使用C#的TCP/IP聊天应用程序 [
Google[^]

First result:
TCP/IP Chat Application Using C#[^]

You spent more time formulating your question, then it took me finding the answer using google.

When you want help with code you are working on, it is usually a good idea to include the problematic section with your question. Then there is an actual chance of receiving the help you need.

@Manfred : That’s why I amended it – your linguistic skills turned it into something more sensible. The code for the article works. If that program works and his doesn’t – he can take a look at the article and maybe it will help him solve his problems. If both fail that will be a fair indication that his problem is not related to his code, it may then be, as SAKryukov points out, network related. (Suddenly I couldn''t post comments)

Regards
Espen Harlinn


这篇关于互联网上的套接字连接问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆