tcplistener

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):

Modify request from Open VPN server

蹲街弑〆低调 提交于 2021-01-07 00:02:26
问题 I'm doing a POC on a product where I need to set up a VPN server and manipulate the request (basically the URL parameters, not the headers/form data). I'll share my findings in this post and the blockers too. Need some advice on the blockers. My setup:- oVPN client -> oVPN server -> Squid Proxy -> Internet | Logstash | Kibana Logstash parses the squid proxy logs (the browsed URLs) and dumps it to ES which is then viewed on kibana. Findings. When my client connects with the VPN server and

C# Tcp BeginAcceptTcpClient throws ObjectDisposedException

﹥>﹥吖頭↗ 提交于 2020-06-01 07:38:26
问题 I'm trying to upgrade from UDP to TCP, but I am completely lost. :( This is my Server code (not too long). private readonly TcpListener _tcpListener; public TCP(IPEndPoint endPoint) { try { _tcpListener = new TcpListener(endPoint); _tcpListener.Start(); AcceptTcpClient(); AcceptSocket(); TestClient test = new TestClient(); test.Connect(); } catch (SocketException e) { Console.WriteLine("SocketException: " + e); } finally { _tcpListener.Stop(); } } private void AcceptSocket() { _tcpListener

Why has the server stopped responding after a change in source code?

南笙酒味 提交于 2020-04-18 12:36:03
问题 I need to implement HTTP protocol through TCP. I already had a TCP/IP client-server program which had been working absolutely fine. Now, I have done some minor change in the source code so that it behaves as an HTTP client-server. But, unfortunately it stopped working. The following code ... public void Write(string str) { if (IsConnected) { byte[] strBytes = Encoding.UTF8.GetBytes(str); byte[] lenBytes = BitConverter.GetBytes(strBytes.Length); Array.Reverse(lenBytes); writer.Write(lenBytes);

Why has the server stopped responding after a change in source code?

余生长醉 提交于 2020-04-18 12:35:59
问题 I need to implement HTTP protocol through TCP. I already had a TCP/IP client-server program which had been working absolutely fine. Now, I have done some minor change in the source code so that it behaves as an HTTP client-server. But, unfortunately it stopped working. The following code ... public void Write(string str) { if (IsConnected) { byte[] strBytes = Encoding.UTF8.GetBytes(str); byte[] lenBytes = BitConverter.GetBytes(strBytes.Length); Array.Reverse(lenBytes); writer.Write(lenBytes);

Why has the server stopped responding after a change in source code?

寵の児 提交于 2020-04-18 12:35:12
问题 I need to implement HTTP protocol through TCP. I already had a TCP/IP client-server program which had been working absolutely fine. Now, I have done some minor change in the source code so that it behaves as an HTTP client-server. But, unfortunately it stopped working. The following code ... public void Write(string str) { if (IsConnected) { byte[] strBytes = Encoding.UTF8.GetBytes(str); byte[] lenBytes = BitConverter.GetBytes(strBytes.Length); Array.Reverse(lenBytes); writer.Write(lenBytes);

How to set TCPListener to always listen and when new connection discard current

ぐ巨炮叔叔 提交于 2020-03-19 14:42:55
问题 I want to admit I'm not the strongest in c# and I have developed this program by looking at several tutorials, I would appreciate a lot if you can be detailed in your answer. I would like my TCP Server to always listening for incoming connections and when a new TCP Client connects, I want it to discard the old connection and use the new one. I have tried to implement this answer; https://stackoverflow.com/a/19387431/3540143 but my issue is the fact that when I'm simulating a TCP client, but

How to set TCPListener to always listen and when new connection discard current

亡梦爱人 提交于 2020-03-19 14:37:06
问题 I want to admit I'm not the strongest in c# and I have developed this program by looking at several tutorials, I would appreciate a lot if you can be detailed in your answer. I would like my TCP Server to always listening for incoming connections and when a new TCP Client connects, I want it to discard the old connection and use the new one. I have tried to implement this answer; https://stackoverflow.com/a/19387431/3540143 but my issue is the fact that when I'm simulating a TCP client, but

How to set TCPListener to always listen and when new connection discard current

无人久伴 提交于 2020-03-19 14:36:32
问题 I want to admit I'm not the strongest in c# and I have developed this program by looking at several tutorials, I would appreciate a lot if you can be detailed in your answer. I would like my TCP Server to always listening for incoming connections and when a new TCP Client connects, I want it to discard the old connection and use the new one. I have tried to implement this answer; https://stackoverflow.com/a/19387431/3540143 but my issue is the fact that when I'm simulating a TCP client, but

How to set TCPListener to always listen and when new connection discard current

有些话、适合烂在心里 提交于 2020-03-19 14:36:31
问题 I want to admit I'm not the strongest in c# and I have developed this program by looking at several tutorials, I would appreciate a lot if you can be detailed in your answer. I would like my TCP Server to always listening for incoming connections and when a new TCP Client connects, I want it to discard the old connection and use the new one. I have tried to implement this answer; https://stackoverflow.com/a/19387431/3540143 but my issue is the fact that when I'm simulating a TCP client, but