使用vb.net的套接字 [英] Sockets usage with vb.net

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

问题描述

您好!


我有一些设备可以通过局域网与服务器进行通信我使用的旧的

表单是FTP作为服务器和服务器之间的通信客户i

决定使用个人TCP套接字而不是使用FTP

协议。我很熟悉套接字,但有些概念我无法获得它。我会使用Vb.Net作为服务器程序,但问题

呵护我的大脑是为了例如.. ip 192.168.0.0.1尝试在服务器上进行通信

端口5444和同时另一台设备用ip

192.168.0.0.2尝试在端口5444上进行通信什么是

结果在这种情况下设备用ip xxx1仍在使用端口

其他设备可以在同一端口上进行通信。


问候

Altaf

Hello !

I have some devices which communicate trough LAN to the server the old
form i was using was FTP as a communication between Server and Client i
have decided to use personal TCP sockets instead of using the FTP
protocol. Well im familar with sockets but some concepts im not able to
get it. I would be using Vb.Net as a server program but the question
pampering my brain is for eg .. ip 192.168.0.0.1 tries to communicate
on the server port 5444 and at the same time another device with ip
192.168.0.0.2 tries to communicate on port 5444 what would be the
result in this case the device with ip x.x.x.1 is still using the port
will the other device can communicate on the same port .

Regards
Altaf

推荐答案

你不是说IP:192.168.0.1&不是192.168.0.0.1?


您可以使用其中一个重载函数来传递特定的端口号。

只需查看套接字类获取信息


VB.NET大大简化了套接字编程

Crouchie1998

BA(HONS)MCP MCSE
Don''t you mean IP: 192.168.0.1 & not 192.168.0.0.1?

You can use one of the overloaded functions to pass a specific port number.
Just see the sockets class for information

Socket programming is greatly simplified with VB.NET

Crouchie1998
BA (HONS) MCP MCSE


al *********** *@gmail.com 写道:
你好!

我有一些设备通过局域网与服务器进行通信我使用的旧形式是FTP作为服务器和客户端之间的通信我决定使用个人TCP套接字而不是使用FTP
协议。我很熟悉插座,但有些概念我无法获得它。我会使用Vb.Net作为服务器程序,但问题是我的大脑是为了...例如.. ip 192.168.0.0.1试图在服务器端口5444上进行通信,同时另一个设备用ip
192.168.0.0.2尝试在端口5444上进行通信将会是什么结果?在这种情况下,带有ip xxx1的设备仍在使用端口
将另一台设备可以在同一个港口沟通。

问候
Altaf
Hello !

I have some devices which communicate trough LAN to the server the old
form i was using was FTP as a communication between Server and Client i
have decided to use personal TCP sockets instead of using the FTP
protocol. Well im familar with sockets but some concepts im not able to
get it. I would be using Vb.Net as a server program but the question
pampering my brain is for eg .. ip 192.168.0.0.1 tries to communicate
on the server port 5444 and at the same time another device with ip
192.168.0.0.2 tries to communicate on port 5444 what would be the
result in this case the device with ip x.x.x.1 is still using the port
will the other device can communicate on the same port .

Regards
Altaf




这是基本概念:


您使用一个端口建立连接(在这种情况下为端口5444)然后您

在随机端口号处打开一个新端口(框架将选择一个端口

for you)这个新端口是所有通信完成的端口,

离开端口5444进行下一次连接。


Chris



This is the basic concept:

You use one port to make a connection (port 5444 in this case) then you
open a new port at a random port number (the framework will pick a port
for you) This new port is the one all the communication is done on,
leaving port 5444 for the next connection.

Chris


这是基本概念:

使用一个端口建立连接(端口5444在这种情况下)然后你打开一个随机端口号的新端口(框架将为你选择一个端口
)这个新端口是所有通信完成的端口,
离开端口5444进行下一次连接。

Chris
This is the basic concept:

You use one port to make a connection (port 5444 in this case) then you
open a new port at a random port number (the framework will pick a port
for you) This new port is the one all the communication is done on,
leaving port 5444 for the next connection.

Chris




很抱歉,但我认为只有UDP连接需要释放公共端口

(在这种情况下为5444),并创建一个随机端口进行通信。用于TCP和UDP连接的

套接字是否以相同的方式工作?


如果我错了,请指出我。谢谢。





Sorry, but I thought only UDP connections needs to release the public port
(5444 in this case), and create a random port for communication. Is the
socket for TCP and UDP connection works in same way?

Please point me out if I am wrong. Thanks.

Kai


这篇关于使用vb.net的套接字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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