client-server

Simple TCPClient/Listener (“hello world”) example

孤者浪人 提交于 2019-12-07 02:19:52
问题 All I'm looking for is a simple TCPClient/Listener ("hello world") example. I'm a newbie and Microsoft TCPClient/Listener class examples are not what I am looking for. All I am looking is for the TCPClient to send a message "Hello world" and for a TCPListener to get the message and to send a message back "I got your hello world message"? A little help would be great. All I have is the TCPClient sending out "Hello World". Would this work? Dim port As Int32 = 13000 Dim client As New TcpClient(

SQLite for client-server

…衆ロ難τιáo~ 提交于 2019-12-06 20:55:44
问题 I've seen a couple of SQLite performance questions here on Stackoverflow, but the focus was on websites, and I'm considering using this DB in a client-server scenario: I expect 1-10 clients for one server for now, could go up to 50 or more in the future. slightly more reads than writes the DB would sit behind a server process (i.e: not using direct DB access through a network) Would using SQLite make the app less responsive as opposed to using PostgreSQL? My intuition tells me that it should

C sockets: why is my server appending extra characters in the end?

谁都会走 提交于 2019-12-06 19:45:33
I am writing a simple server/client socket in C. The client asks the user to input a message and the server responds by repeating the same. The problem is when I send a message from the client the server responds back by appending extra character. How do I fix this. This is my Client code while(1) { bzero(buffer, BUFSIZE); printf("Enter Message: "); scanf("%s", buffer); //send some data if(send(socket_fd, buffer, strlen(buffer), 0) <0) { fprintf(stderr,"sending failed\n"); return 1; } //receive a reply from the server if(recv(socket_fd, server_reply, BUFSIZE,0)<0) { fprintf(stderr,"failed to

Indy 10 + Delphi Client-Server App Eats up all CPU

你。 提交于 2019-12-06 17:49:29
I wrote a small client-server application that runs on two or more distinct machines for reboot / shutdown purposes. Since I'm relatively new to client-server apps, I took the About Delphi approach here . Shortly put, my server app awaits connections on port 7676, adds the client to a client list then does nothing (will implement the shutdown and restart procedures later). However, even if it's passive, it eats up to 90% of CPU with only two clients connected. Here's the client code, made up of an TidTCPServer and a TidAntiFreeze: type PClient = ^TClient; TClient = record PeerIP : string[15];

Socket single client/server connection, server can send multiple times, client can only once

前提是你 提交于 2019-12-06 16:13:36
问题 I have written a client and server application that I need to use to connect a checkers game I made in C#. I have got the client and server to connect and the server can repeatedly send the client messages to update a label but when the client tries to send a message it throws the error "A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied." Here is my client and server so far.

How to Push data from C# to ZeroMQ and Pull from Node.JS or vice-versa?

限于喜欢 提交于 2019-12-06 15:54:08
Scenario : I am trying to send a data (say String type) from C# сonsole application to Node.JS server through ZeroMQ. Information: Using clrzmq for c# and ZeroMQ libs for C# and Node.JS respectively I am able to perform push-pull from Node.JS, also push - pull from C#. So, one thing is confirmed that ZeroMQ - The Intelligent Transport Layer is installed on the machine (Windows 7 64-bit) Issue : I am not able to push data from C# Console app to Node.JS app (even tried vice-versa), both are on the same machine and on the same address i.e tcp://127.0.0.1:2222 Node.js code: var zmq = require(

P2P using web browser

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 15:19:49
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! Your game would have to be written as a browser plugin since browsers don't support this kind of thing. It looks like BITLET uses java, which would

TDD on client-server application

核能气质少年 提交于 2019-12-06 15:04:46
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? 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 code dealing with the mechanics of the connection. Write tests, one at a time, specifying the correct response

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

点点圈 提交于 2019-12-06 13:36:52
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 The safe way to close a socket connection is first calling shutdown to signal that you won't be writing, keep reading the data that the remote side sends, and

How to check network provider name in iOS programming?

天涯浪子 提交于 2019-12-06 13:01:03
问题 I need to check whether device has been connected properly to "My-Wifi" network or not. If it is connected then I will send some data to server otherwise not. Right now I am just checking with the Internet connection, using Reachability class. So how to check that? 回答1: You can make use of CNCopySupportedInterfaces() call. CFArrayRef interfaces = CNCopySupportedInterfaces(); CFIndex count = CFArrayGetCount(interfaces); for (int i = 0; i < count; i++) { CFStringRef interface =