tcpclient

TCP load balancing and rerouting based on first few bytes

痴心易碎 提交于 2021-02-09 14:27:32
问题 I have made a game where clients connect to a central server with TCP connection. In the first 6 bytes I send the version number "00.00.01" of the client protocol. Based on this version I want to route/proxy the tcp connection to different servers where different version of the game will be running. Basically client-1 with version 00.00.01 should connect to Server-1 And client 2 with version 00.00.02 should connect to Server-2 For load balancing I checked HAProxy lua support but couldn't find

C# best way to implement TCP Client Server Application

家住魔仙堡 提交于 2021-02-08 11:42:19
问题 I want to extend my experience with the .NET framework and want to build a client/server application. Actually, the client/server is a small Point Of Sale system but first, I want to focus on the communication between server and client. In the future, I want to make it a WPF application but for now, I simply started with a console application. 2 functionalities: client(s) receive(s) a dataset and every 15/30min an update with changed prices/new products (So the code will be in a Async method

Whats faster sending multiple small messages or less longer messages with TCP Sockets

你。 提交于 2021-02-07 09:23:15
问题 I can find any documentatin anywhere and would like to know what would be the best method of send multiple messages as fast as possible. for example if I had 300 devices recieivng messages from one server would it be better to send out one big message and have the devices pick out the parts that they need or send 300 messages but at 1/300 of the size. They would only be small stings so the 300 devies would only be getting 6 bytes each Does it make a difference? Thanks in advanced. 回答1: If the

SslStream equivalent of TcpClient.Available?

岁酱吖の 提交于 2021-02-07 05:48:05
问题 Based on the advice of @Len-Holgate in this question, I'm asynchronously requesting 0-byte reads, and in the callback, accept bytes the available bytes with synchronous reads, since I know the data is available and won't block. This seems so efficient and wonderful. But then I add the option for SslStream, and the approach falls apart. The zero-byte read is fine, but the SslStream decrypts the bytes, leaving a zero byte-count in the TcpClient's buffer (appropriately so), and I cannot

Reuse a TcpClient in c#

白昼怎懂夜的黑 提交于 2021-01-29 11:10:37
问题 We have a device that accepts ascii messages over a wireless network, and then responds with a value and I have successfully implemented this in a Windows Forms 2010 solution in c#. I wrote this as a test solution to prove the technology and the actual calls to the device will be made on a Motorola MC55 handheld device. I have now written an additional test solution in Visual Studio 2008 and installed this onto a device, but the connection to the TcpClient takes around 30 seconds every time

TCPListener and StreamSocket

本秂侑毒 提交于 2021-01-29 10:32:53
问题 I have an odd problem. I'm trying to get a TCP connection going from my local PC to a remote hololens. On PC, I use the standard C# APIs (TCPClient, TCPListener) and on the Hololens I'm forced to use the UWP stuff (StreamSocket, StreamSocketListener). I have tested the following configurations: StreamSocket (local PC) <-> StreamSocketListener (Hololens): Working StreamSocketListener (local PC) <-> StreamSocket (Hololens): Working TCPClient (local PC) <-> StreamSocketListener (Hololens):

How to correctly use TPL with TcpClient?

那年仲夏 提交于 2020-06-27 15:49:12
问题 I wrote a server using TcpListener that is supposed to handle many thousands of concurrent connections. Since I know that most of the time most connections will be idle (with the occasional ping-pong to make sure the other side is still there) async programming seemed to be the solution. However after the first few hundred clients performance rapidly deteriorates. So rapidly in fact that I can barely reach 1000 concurrent connections. The CPU is not maxed out (averaging at ~4%), RAM usage is