开发者

how to send and receive a tcp message to a specific IP/Port in .NET

开发者 https://www.devze.com 2023-03-06 11:59 出处:网络
I\'m trying开发者_运维知识库 to send a message to a specific IP/Port and receive a reply in an ASP.net website, i tried the method describd at the following link but it didn\'t work for me as you can

I'm trying开发者_运维知识库 to send a message to a specific IP/Port and receive a reply in an ASP.net website, i tried the method describd at the following link but it didn't work for me as you can see : https://stackoverflow.com/questions/6022407/socketexception-an-attempt-was-made-to-access-a-socket-in-a-way-forbidden-by-its

is there any ideas to solve this problem,or any other ways to achieve this

Thank you very much , i really appreciate your help


Use TcpClient or Socket classes.

The first one is simpler and basically is a wrapper around the second one.

You probably just need WebRequest. It is even simpler, if it meets your needs of course.

0

精彩评论

暂无评论...
验证码 换一张
取 消