client-server

How Server Sent Event send response to a specific client

别等时光非礼了梦想. 提交于 2020-01-01 16:56:32
问题 In Server Sent Event, it always send the same response to all the client. but what i want to know is, How to send response to an only one client using java. this is my event which define inside sw.js (SSE) var eventSource = new EventSource("HelloServlet"); eventSource.addEventListener('up_vote',function(event){ console.log("data from s" , event.data); var title = event.data; self.registration.showNotification(title, { 'body': event.data, 'icon': 'images/icon.png' }) }); I want to show this

how to print on client printer from server using php

喜你入骨 提交于 2020-01-01 15:36:14
问题 I want to print a pdf file(pdf file is on server) using php (php is also running on server) on client computer. How can I do this. Thanks in advance for you help 回答1: You cannot do this directly, as the php/apache server runs on a completely different computer(and maybe geographic location) than the browser/client. You can however use intermediate solutions, like proprietary, custom applications installed on the client's computer that "talks" to the server and requests files to be printed.

what type of network programming is necessary in iPhone online multiplayer game?

你离开我真会死。 提交于 2020-01-01 12:32:09
问题 I am asking this question as a small part of my question series regarding game programming . Refer this question as the main one . Now suppose I want to develop a game on iphone - a simple online multiplayer board game. Suppose its a casino table. In the main question ChrisF has tell me of sort of Client - Server architecture for iphone online multiplayer game. I want to know what sort network programming I have to do for this type of application . What will be the responsibilities and

How can I handle multiple clients connected to a server using sockets?

こ雲淡風輕ζ 提交于 2019-12-31 22:29:31
问题 I have an Android app that needs to let multiple devices connect. One device should act as the group owner and issue instructions to all of the clients to do specific things. I suppose it's comparable to a wireless handheld game where one player is the host. I have a couple of questions so I will try to keep them concise. Even an answer to just the first would help. First, I've successfully paired a single server and single client phone using sockets. I did this using Android's Wi-Fi Direct

How to do a non-waiting write on a named pipe (c#)?

痴心易碎 提交于 2019-12-31 07:20:08
问题 I'm using .net 3.5 named pipes and my server side is : serverPipeStream = new NamedPipeServerStream("myPipe", PipeDirection.InOut, 1, PipeTransmissionMode.Byte, PipeOptions.Asynchronous); When I write some data with, say, BinaryWriter, the write() call itself doesn't return until the client side has called a read() on its NamedPipeClientStream. The BinaryWriter is : writer = new BinaryWriter(serverPipeStream); I'm aware that NamedPipeServerStream offers a BeginRead/BeginWrite but from what I

Why isn't my application entering my if statement

こ雲淡風輕ζ 提交于 2019-12-31 04:03:59
问题 I'm trying to write a console client-server application in Java; using sockets, I currently have a simple login system and a simple command system. The login system appears to work, although it prints the "Invalid username and password" line to the client, regardless whether the user inputs correct credentials. - The connection is definitely working. However, the command system does not seem to function at all, when the command is received by the server, it does not appear to send anything

Why isn't my application entering my if statement

拟墨画扇 提交于 2019-12-31 04:02:18
问题 I'm trying to write a console client-server application in Java; using sockets, I currently have a simple login system and a simple command system. The login system appears to work, although it prints the "Invalid username and password" line to the client, regardless whether the user inputs correct credentials. - The connection is definitely working. However, the command system does not seem to function at all, when the command is received by the server, it does not appear to send anything

RAW client-server socket python

人盡茶涼 提交于 2019-12-30 16:18:16
问题 I would like to realize a RAW socket in Python and then send data from the Client to the Server. Unlike a normal socket I've tried to use the following definition s = socket.socket(socket.AF_PACKET, socket.SOCK_RAW) but commands as s.listen(1), s.connect() are not working. I have no clue how to program both the Client.py and the Server.py. Can someone help me? 回答1: That's because a raw socket doesn't utelize the Ethernet/TCP/IP library at all. It's a RAW socket, you're in charge of whatever

Using H2 database server how to notify changes to clients (JMS messaging)

断了今生、忘了曾经 提交于 2019-12-30 07:52:20
问题 I am successfully using H2 database in AUTO_SERVER mode so that a database file is shared among a number of desktop clients on a network transparently. This way a server is elected among the clients and all other clients read from the tcp server. What I'm missing is how a client or the server can notify all other desktop clients something has been changed in the database. Right now I'm using a JGroups channel to let all clients comunicate one with each other however this is another point of

ServerSocket accept() not accepting connections on Android

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-30 05:08:06
问题 I am trying to setup at ServerSocket on my Android phone, and send a char or int or anything from my computer. The code on the phone creates a ServerSocket and then blocks whilst waiting for a connection: ServerSocket serverSocket = ServerSocketFactory.getDefault() .createServerSocket(4444); Log.d("HostThread", "ServerSocket created:"+serverSocket .getInetAddress().getHostAddress()); Socket socket = serverSocket.accept(); (The log says "10-27 11:41:43.437: DEBUG/HostThread(23957):