将客户端添加到客户端类(新列表(classforclient)) [英] Add a client to a client class (new list(of classforclient))

查看:82
本文介绍了将客户端添加到客户端类(新列表(classforclient))的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序与正常的客户端服务器通信相反,因为它需要以反向方式工作。

正常的客户端/服务器系统在客户端将发起呼叫的情况下工作服务器然后服务器响应。

我需要服务器启动对客户端的调用,服务器每次都会使用相同的连接。

有多个客户端每个都有自己的IP地址。



我应该解释一下,客户将是工业打印引擎,操作员将打开它们,然后在PC上运行软件与他们沟通。

打印机在发送命令之前不发送任何命令或握手,然后他们将回复命令。

我想拥有我可以在服务器上列出的客户端,我可以向每台打印机发起呼叫。



我想找到一种方法来手动或预设客户端详细信息(ipaddress,port等等)在服务器上在客户名单中?



问候,

Glenn Sharp

<电子邮件已删除>



我的尝试:



我有一个客户端/服务器系统在哪里运行通过hyperterm进行通信以启动连接。

所以,如果我开始连接,我可以发送我需要发送的命令,这些命令通常会发送给打印机。

我正在使用一个ClientList来保存客户端连接。

我需要手动将客户端添加到客户端列表中,这部分我无法解决该怎么做。





My application is a reverse to the normal "client Server" communications in that it needs to work in the reverse method.
The normal client/server system works where the client will initiate a call to the server the server then responds.
I need to have the server initiate the call to the client where the server will use the same connection each time.
There are multiple clients each with their own Ip address.

I should explain, the clients will be industrial print engines where the operator will turn them on and then run the software on a PC to communicate with them.
The printers do not send any command or handshaking until a command is sent to them, they will then reply to the command.
I want to have the clients listed on the server where I can initiate a call to each printer.

I would like to find a way to manually or have preset the client details (ipaddress, port,etc) on the server in the clientlist?

Regards,
Glenn Sharp
<Email removed>

What I have tried:

I have a client/server system running where I can communicate via hyperterm to initiate a connection.
so if I start a connection I can send the commands I need to send that would normally go to the printer.
I am using a "ClientList" to hold the clients as they connect.
I need to manually add a client to the clientlist, it is this part I cannot work out how to do.


Private listClient As TcpClient
    Sub New(ByVal forClient As TcpClient)
        listClient = forClient
        listClient.GetStream.BeginRead(New Byte() {0}, 0, 0, AddressOf ReadAllClient, Nothing)
    End Sub

推荐答案

Quote:

我的应用程序是反向的它需要工作的正常客户端服务器通信相反的方法。

...

我应该解释一下,客户将是工业打印引擎,操作员将打开它们,然后在PC上运行软件与他们沟通。

打印机在发送命令之前不发送任何命令或握手,然后他们将回复命令。

My application is a reverse to the normal "client Server" communications in that it needs to work in the reverse method.
...
I should explain, the clients will be industrial print engines where the operator will turn them on and then run the software on a PC to communicate with them.
The printers do not send any command or handshaking until a command is sent to them, they will then reply to the command.



搭配就像一个误解。

所有这些打印机引擎都是服务器的服务器,而你的服务器是所有这些打印机引擎的客户端。

你需要以这种方式重新思考你的问题当你被卡住时回来。


Looks like a misunderstanding.
All those printer engines are servers to your server, and your server is a client of all those printer engines.
You need to rethink your problem this way and come back when you are stuck.


这篇关于将客户端添加到客户端类(新列表(classforclient))的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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