client-server

Can I use DataGridView without using database data?

时光总嘲笑我的痴心妄想 提交于 2019-12-08 04:23:27
问题 I have a client-server program and the server receives [Process ID, Hostname, App Name, File Path] and I want to put them in a table. As of now they are sent in one string. Is DataGridView applicable to use even if they are not inside a database or is there another option? Thanks. 回答1: The short answer is Yes. You can use a List<T> as DataSource You can use a DataTable as DataSource (DataTable not related to db) You can use it without DataSource and only defining columns and adding rows Use

P2P using web browser

怎甘沉沦 提交于 2019-12-08 03:26:10
问题 I've been told that some torrent sites like BITLET or MININOVA allow you to download from other users, and obviously other users to download from you while you have your browser open. I would like to create something similar for a game, where: 1. User A and B are connected to a specific website 2. User A knows the IP and port of B 3. User A starts downloading some information from user B Could anyone give me some tips or keywords to start? Thanks! 回答1: Your game would have to be written as a

ServerSocket java-server reads input only once?

女生的网名这么多〃 提交于 2019-12-08 03:02:18
问题 I have written a java server and here is the code: try { ss = new ServerSocket(8080); while (true) { socket = ss.accept(); System.out.println("Acess given"); in = new BufferedReader(new InputStreamReader(socket.getInputStream())); //out = new PrintWriter(socket.getOutputStream(),true); line = in.readLine(); System.out.println("you input is :" + in.readLine()); } } And an iphone application is the client and there is the code for it: - (void)viewDidLoad { [super viewDidLoad]; socket = [

How to handle socket read in C when the remote server closes socket possibly before read is finished?

五迷三道 提交于 2019-12-08 02:50:03
问题 Client blocks on the read call waiting to read n bytes. Server writes n bytes and closes the connection immediately. Can read call return negative or zero in this case if the socket gets closed before read is finished or due to some other issue? (client/server running on same linux box in this case) I am facing such a scenario but not sure how this works in TCP/IP subsystem and how to resolve it. Sever: write close Client: read close 回答1: The safe way to close a socket connection is first

TDD on client-server application

北慕城南 提交于 2019-12-08 02:43:37
问题 Currently I'm creating a server application to receive protocol-specific messages. I need to create tests to ensure that I've implemented the protocol correctly. Is this some kind of integration testing? If positive, can I make an integration testing with unit testing tools? And finally, what is the best way to create these kind of tests? 回答1: If you know what the correct responses are, then here's what I'd do: Separate the class responsible for the logic of handling the protocol from the

Server not able to properly read/open a filename sent by client in C

被刻印的时光 ゝ 提交于 2019-12-08 02:07:48
问题 I'm doing client/server interaction with sockets in C. What I'm trying to do is have the client request a file to be read on the server, the server return a buffer of the file contents, and the client print out the file. Though I was able to accomplish the server sending a buffer of a file to the client & the client printing it out successfully, I can't seem to get the server to successfully read a filename sent by the client. Here is what I mean: ///This is the structure of the message that

How to Send data from server to clients using select

試著忘記壹切 提交于 2019-12-08 01:54:43
问题 I came up with a code with help of some tutorials to connect with clients and accept messages from slients using the select function. Now I want to do is send data to a particular client when the server needed. How to accomplish this??.. Thanks in advance. Server code #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/types.h> #include <sys/time.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <netdb.h> #define PORT

Java server-client readLine() method

馋奶兔 提交于 2019-12-08 00:25:45
问题 I have a client class and a server class. If client sends message to server, server will send response back to the client, then client will print all the messages it received. For example, If Client sends "A" to Server, then Server will send response to client "1111". So I use readLine() in client class to read the message from server, then client print "1111" in the console. If Client sends "B" to Server, then Server will send response to client "2222\n 3333". So the expected printing output

Should I use WPF or Windows Forms Application for my project in C#?

拟墨画扇 提交于 2019-12-07 23:10:32
问题 I am developing a Client-Server based application in which client application will access server database to store billing information. It will also have report generation facility. Windows Forms is good in document printing & I don't see such facility or controls in WPF. If I am wrong then please correct me. I want database security, which DB should I use, SQL Server, MySQL or Oracle. I would like to use free DB but security is my priority. Please suggest how I can implement a Client-Server

python: how to detect client disconnection on the server side?

只谈情不闲聊 提交于 2019-12-07 22:34:51
问题 I am working on socket programming in python and I want to detect client socket disconnection on server side. Client: socket.connect(host, port) try: """ send something to server and get response from the server""" except KeyboardInterrupt: socket.shutdown(socket.SHUT_RDWR) socket.close() Server: conn, address = socket.accept() try: conn.send(message) except: print "-1" But when I first run this code, I close the client by keyboard interrupt and the server won't print -1 in the screen. When I