Tcp连接无法正常工作 [英] Tcp connection not working

查看:83
本文介绍了Tcp连接无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当这部分在我的程序中运行时,当Client.Connect行运行时,我收到错误输入字符串格式不正确,有人可以帮助我,谢谢。



When this part runs in my program, I get the error "Input string was not in a correct format" when the Client.Connect line runs, could somebody help me, Thanks.

Public Client As Socket
    Public IP As String = "69.172.201.153"
    Public Port As Integer = 80
 Client = New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
        Client.Connect(New IPEndPoint(Long.Parse([IP]), [Port]))





我尝试了什么:



我还没有找到任何可以做的事。



What I have tried:

I haven't found anything to do yet.

推荐答案

以下是一个示例:同步客户端套接字示例| Microsoft Docs [ ^ ]

Here is an example: Synchronous Client Socket Example | Microsoft Docs[^]
Dim remoteEP As New IPEndPoint(ipAddress, 11000)  
Dim sender As New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)  
sender.Connect(remoteEP)


这篇关于Tcp连接无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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