client-server

Ways to make two way communications for notification using .NET

风格不统一 提交于 2019-12-07 17:51:52
问题 I have a server/client project, I am using C# for coding, WCF as server. I am limited to HTTP, had no luck with wsdualhttpbinding so far. Project is working on company network. Is there any way to send notifications from server to client in any way other than WCF duplex? Please tell all options. 回答1: I am assuming because of firewall issues you have problems with an incoming connection. In such a scenario a common way to solve the problem is. Have a separate thread from which you poll the

How to detect that the client is still connected (and not hung-up) using recv()?

廉价感情. 提交于 2019-12-07 17:13:52
问题 I have written a multiclient Server program in C on SuSE Linux Enterprise Server 12.3 (x86_64) , I am using one thread per client to receive data. My problem is: I am using one terminal to run the server, and using several other terminals to telnet to my server (as client). I have used recv() in the server to receive data from client, I have also applied checks for return value of recv() i.e. Error on -1 ; Conn. Closed on 0 & Normal operation else. I have not used any flags in recv() . My

PHP Sockets with SSL / TLS - no suitable shared cipher could be used

半世苍凉 提交于 2019-12-07 16:59:16
问题 I am attempting to create a server and client using PHP Sockets with SSL / TLS. However, when sending data to the server, I receive the following error: PHP Warning: stream_socket_accept(): SSL_R_NO_SHARED_CIPHER: no suitable shared cipher could be used. This could be because the server is missing an SSL certificate (local_cert context option) in server.php on line 32 I've looked at other examples and tried various changes to no avail. Any help could be much appreciated. client.php <?php

Sending data from a browser to a server and back

一世执手 提交于 2019-12-07 16:29:21
问题 I am C++ developer and I haven't really followed up on any development related to the web for a very long time. I have this project I would like to implement, really as a goal to sort of catch up on these technologies. My project is this: display some content in a browser (for example the content of a 3D scene using a canvas and WebGL), have a button on the page. When the button is clicked, send the data to the server (the camera position for instance), render the image on the server (using

How to get screen resolution with node.js

≯℡__Kan透↙ 提交于 2019-12-07 14:47:33
问题 I need get screen resolution with node.js, but the following code don't work. var w = screen.width; var h = screen.height; This also don't work. var w = window.screen.width; var h = window.screen.height; Someone know how to get screen resolution with node.js ? Thank you. 回答1: There is now a screenres module via npm: https://www.npmjs.com/package/screenres 回答2: You should retrieve the window.screen.width and window.screen.height in your client-side JavaScript code and send that information to

C- Socket : Programming a Client/Server-Application to send a file

允我心安 提交于 2019-12-07 14:28:11
问题 I want to program an application to send a file with sockets: Here my Server: void str_server(int sock) { char buf[1025]; const char* filename="test.text"; FILE *file = fopen(filename, "rb"); err_abort("Test"); while (!feof(file)) { int rval = fread(buf, 1, sizeof(buf), file); send(sock, buf, rval, 0); } } and here my client: void RecvFile(int sock, const char* filename) { int rval; char buf[0x1000]; FILE *file = fopen(filename, "wb"); while ((rval = recv(sock, buf, sizeof(buf), 0)) > 0) {

Architecture used by dropbox

≡放荡痞女 提交于 2019-12-07 13:48:04
问题 I want to know whether client-server or peer-to-peer architecture is used by dropbox. Here my doubt lies: Suppose we have two systems which are synced via dropbox. System1: dropbox > Folder_A > file_1 System2: dropbox > Folder_A > file_1 Initially both are synced. Suppose now, User on System1 adds a file_2 in Folder_A. Now this file gets uploaded to dropbox server. But my question is how does server notifies System2 about file_2. I am seeing Observer Pattern being used here. But Is Pull or

How to make “Enter” Key Behave like Submit on a JFrame

心已入冬 提交于 2019-12-07 08:46:00
问题 I'm Building a Client/Server application. and I want to to make it easy for the user at the Authentication Frame. I want to know how to make enter -key submits the login and password to the Database (Fires the Action) ? 回答1: One convenient approach relies on setDefaultButton(), shown in this example and mentioned in How to Use Key Bindings. JFrame f = new JFrame("Example"); Action accept = new AbstractAction("Accept") { @Override public void actionPerformed(ActionEvent e) { // handle accept }

Circular references between two classes

筅森魡賤 提交于 2019-12-07 04:56:58
问题 I know this must be a n00b question, but I have to implement a mockup client-server sequential interaction application, and because the number of client-server calls varies, I cannot just iterate the steps in an external function, always fetching data from the client and then forwarding it to the server and vice-versa, so I need to make my Server and Client classes be aware of each other so that they can call their public methods between themselves. One approach would be to design both as

Receiving data from already closed socket?

烂漫一生 提交于 2019-12-07 04:11:19
问题 Suppose I have a server application - the connection is over TCP, using UNIX sockets. The connection is asynchronous - in other words, clients' and servers' sockets are non-blocking. Suppose the following situation: in some conditions, the server may decide to send some data to a connected client and immediately close the connection: using shutdown with SHUT_RDWR . So, my question is - is it guaranteed, that when the client call recv , it will receive the (sent by the server) data? Or, to