[英]How can i make an application to send messages not knowing the ip address of the receiver application?
I've got 3 programs, 我有3个程序
The web application doesn't know the IP address of the GUI, so i suppose it will send the message to a port. Web应用程序不知道GUI的IP地址,因此我想它将把消息发送到端口。 The GUI knows the IP address of the web application and the port and listens all the time for incoming messages.
GUI知道Web应用程序的IP地址和端口,并始终侦听传入消息。
I tried to make the GUI client and the web application client but without success. 我试图制作GUI客户端和Web应用程序客户端,但是没有成功。 Any suggestions how can i make the GUI program to listen for messages and the web application to send messages?
有什么建议可以使GUI程序侦听消息并通过Web应用程序发送消息吗? I would really appreciate if you paste me some code because I'm new in programming.
如果您粘贴一些代码,我将不胜感激,因为我是编程新手。
Thanks. 谢谢。
If the GUI knows the address of the web application, but not vice versa, then it's the web application that should listen for connections. 如果GUI知道Web应用程序的地址,反之则不然,则应由Web应用程序监听连接。 When the GUI starts, it should connect to the web application.
GUI启动时,它应连接到Web应用程序。 The web application should receive this connection, remember it, and allow several connections at once (several GUIs running at the same time).
Web应用程序应该接收此连接,记住该连接,并一次允许多个连接(多个GUI同时运行)。 Whenever there's somthing to report, the web application should report to all the connections it has remembered, and if there's any error sending the message, close and forget exactly the single connection that caused the error.
每当有什么要报告的内容时,Web应用程序都应该向它记住的所有连接报告,并且如果在发送消息时出现任何错误,请关闭并完全忘记引起错误的单个连接。
But to be honest, if you're serious about 但说实话,如果您是认真的
paste me some code because i am new in programming
then you shouldn't be starting with client/server software and inter-process communication. 那么您不应该从客户端/服务器软件和进程间通信开始。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.