system.net.sockets

SocketException when trying to send data to mongoDB on Azure

夙愿已清 提交于 2020-05-18 01:44:28
问题 I have a mongodb replica set hosted in a VM wjth Windows Server 2012 R2 on the Azure platform, my problem is that when I'm trying to insert data from an external client using the C# driver or even consulting them from a GUI client (mongoVUE, robomongo ...) I often get the following exception which permanently locks the program (even trying a Server.reconnect() does not resolve). No such host is known Type: System.Net.Sockets.SocketException Stack: at System.Net.Dns.GetAddrInfo(String name) at

How to tell how much data is in a Socket's send buffer

早过忘川 提交于 2019-12-22 08:38:06
问题 I can tell how much data is in a Socket's receive buffer by calling Socket.IOControl(IOControlCode.DataToRead, null, outValue); Is there an equivalent to tell how much data is in a Socket's send buffer? I need to send as many UDP packets as possible over a bandwidth and latency-constrained network, and I am running into a situation where I am overflowing the send buffer, and so I need to implement some form of throttling. 回答1: UDP socket does not have a send buffer. The meaning of the SO

TCPIP connection in c# and data sending/receiving in another threads

最后都变了- 提交于 2019-12-20 06:11:53
问题 I have a problem with my TCPIP connection Form programm. I have a code, where I'm trying to send and receive some data from server. The main problem of my app is how to reconcile some threads: myListenThread - to listening data from server myReadStreamThread - to read data from server System.Threading.Thread - main thread eg. to write data to server captureThread - to do another things like capturing images from camera Part of my code: private void buttonConnect_Click(object sender, EventArgs

How to tell how much data is in a Socket's send buffer

妖精的绣舞 提交于 2019-12-05 16:12:36
I can tell how much data is in a Socket's receive buffer by calling Socket.IOControl(IOControlCode.DataToRead, null, outValue); Is there an equivalent to tell how much data is in a Socket's send buffer? I need to send as many UDP packets as possible over a bandwidth and latency-constrained network, and I am running into a situation where I am overflowing the send buffer, and so I need to implement some form of throttling. UDP socket does not have a send buffer. The meaning of the SO_SNDBUF socket option for UDP is the limit on the size of the datagram you can send. The kernel usually does have

TCPIP connection in c# and data sending/receiving in another threads

最后都变了- 提交于 2019-12-02 11:26:07
I have a problem with my TCPIP connection Form programm. I have a code, where I'm trying to send and receive some data from server. The main problem of my app is how to reconcile some threads: myListenThread - to listening data from server myReadStreamThread - to read data from server System.Threading.Thread - main thread eg. to write data to server captureThread - to do another things like capturing images from camera Part of my code: private void buttonConnect_Click(object sender, EventArgs e) { try { Connect(); Connected = true; this.myListenThread = new Thread(new ThreadStart(Listen));

C# SuperSocket without protocol

让人想犯罪 __ 提交于 2019-11-30 18:30:55
问题 The question is simple: I've read the whole SuperSocket documentation but I don't understand if there is a way to use it without implement a protocol. I don't need to send specific commands but only bytes which might be one or hundreds, depending by many factors. I need to renew an old TCP server that uses simple sockets, it was made by me using System.Net.Sockets libs more than 4 years ago and I'd like to realize a stronger solution using a well note library as SuperSocket is. Is it a good