Questions tagged [system.net.sockets]

65 questions
1
vote
1 answer

TypeInitializationException when setting ServicePointManager.ServerCertificateValidationCallback with tracing off

I'm getting an unhandled TypeInitializationException exception when I try to set ServicePointManager.ServerCertificateValidationCallback += (a, b, c, d) => true; The exception happens when I've got the following (taken from MSDN) in my app.config.…
eoinmullan
  • 1,157
  • 1
  • 9
  • 32
1
vote
0 answers

c# Socket Randomly Stops Receiving

This question may be very hard to answer or perhaps somebody knows a common reason. I have 1 server, 5 clients; Socket client Socket listener Every 5000 MS the client checks for a file on the server (Which is Windows 7)via socket, if found the…
clamchoda
  • 4,411
  • 2
  • 36
  • 74
1
vote
1 answer

Failing to load byte[] or base64 data in Couchbase using C# client

When trying to in/upsert a document using either byte[] or a base64 encoded string I'm getting an exception and a !result.Success Specified argument was out of the range of valid values. Parameter name: count My document doesn't contain anything…
Delaney
  • 1,039
  • 1
  • 9
  • 15
1
vote
0 answers

Tcp client to node js server connection refused

I am trying to connect a system.net tcp client to a node js server. The server is running and can be connected to from elsewhere, but when i try and connect from the system.net socket the connection gets refused. here is the client code string…
shinAcku
  • 44
  • 4
1
vote
1 answer

How to distinguish between Socket Objects

Hello I am creating a card game and using System.Net and System.Net.Sockets classes. What I am having a hard time doing is figuring out how I am going to distinguish who did what and who to send that packet of information to. For example here is…
Timg
  • 227
  • 1
  • 3
  • 12
1
vote
1 answer

Dns.GetHostEntry doesn't convert string which contains IP

The function Dns.GetHostEntry doesn't handle ipaddresses as strings e.g. 127.0.0.1 but if I pass google.de as a parameter it works quite well. Am I doing something wrong ? public static Socket connSock(string Server, int Port) { Socket s =…
1
vote
2 answers

C# After string is sent via Networkstream, it can be read but doesn't work with "if"

I've written a little socket application in C# that checks for the current version of my program at every start, now in my test program for this everything works, i can send the string from the server and it will be properly shown on the client,…
user1829695
1
vote
2 answers

nullreference of system.net.sockets on monotouch

I have three versions of the same application: iPhone, Mono Console, Windows Console application. All of them contain exactly the same code (via MonoTouch C#). On the Mono(Touch) framework I get the following exception from the Assembly Browser:…
r712m
  • 299
  • 3
  • 7
1
vote
0 answers

Why does Visual Studio break System.Net.Socket with each different user session?

I know that I don't have a normal setup, but here it is: I work in a computer lab, and the computers run on a disk image using Deep Freeze and Each time you login to Windows 7, I believe that it is initialized each login; user settings are not…
0
votes
0 answers

SocketException when using NpgsqlConnection

Getting a very generic error and cannot seem to find enough information apart from saying it's an error which shouldn't happen. Code below produces the following error: NpgsqlConnection Conn = new…
0
votes
1 answer

How to create new ServerSocket C#

using System; using System.Collections.Generic; using System.Text; using System.Net; using System.Net.Sockets; namespace PowerCarsMobileServer { class Server { public static int Port { get; private set; } private static…
0
votes
0 answers

Clear net.socket of any data

I am writing a game server in node.js for an upcoming game that I am making. The game is written in another language (GML) and I am making the server in JavaScript. I use socket.write to send data to the client, however I don't want the previous…
0
votes
0 answers

C# Windows form application freezing when created

So around a week ago I started to test out Sockets in C# and I had an idea to make 1 to 1 chat application which could be opened if a message was sent through the NetworkStream, however, I ran into a problem where once the button is pressed, the…
Kev
  • 13
  • 5
0
votes
1 answer

Making net.Socket connection to remote port in a node API endpoint

I've a ues case, where I need to connect to the remote socket and send incoming HTTP payload. Here is a sample code that I've written, const net = require('net'); const express = require('express'); var backendConfig =…
Aashish P
  • 1,894
  • 5
  • 22
  • 36
0
votes
0 answers

How to make different users connect to the same socket?

I'm writing a simple chat app using Node.js. The server-side code is : const net = require('net'); const HOST = 'localhost'; const PORT = 3000; const server = net.createServer(); server.listen(PORT, HOST); server.on('connection', (socket) => { …
E.Omar
  • 109
  • 1
  • 11