Questions tagged as 'tcpclient'

3
answers

SQLSERVER ERROR in C # application

I have a problem with the SQLSERVER database. I try to connect from a point to the server and the error appears:    Network-specific or instance-specific error when connecting to   SQL Server. The server was not found or was not accessible...
asked by 01.07.2015 / 16:11
1
answer

How to find out if TCP Listener is listening?

Library that I use: link Follow the code below: await client.ConnectAsync(address, port); The above code is the client and works normal. Let's say the server is off, when I run the above code, it takes little time and I get error:  ...
asked by 20.03.2018 / 21:07
1
answer

Bidirectional Communication - Send and Receive string value correctly

Follow the server code: int port = 11000/*PortGranter.GrantPort()*/; TcpSocketListener listener = new TcpSocketListener(); var tcs = new TaskCompletionSource<ITcpSocketClient>(); await listener.StartListeningAsync(port); listener.Conn...
asked by 16.03.2018 / 15:48
1
answer

What if I want to send and receive a "package"?

I ran a mini server test online and everything worked fine, the problem is that I want to send integers, booleans, strings, etc ... So far I only know how to send string, how to take the first steps? For now I'm using this: string dataFromServ...
asked by 28.08.2016 / 18:01
1
answer

Error attempting asynchronous connection

I am trying to do this in order not to crash the application while waiting for the server to accept the connection. I saw what you can do with async and await . But when trying to use them to wait for the connection without crashing...
asked by 09.10.2017 / 04:42
1
answer

How to encrypt and decrypt data to be transmitted via sockets?

I have a program that logs in with my server, however the connection is without any protection. I looked for some ways to protect but it seems that some of them have a pass code, in the client, but I need to make the connection encrypted, and pr...
asked by 09.05.2015 / 20:08
1
answer

reverse connection in C #

I'm having difficulty using reverse connection between client and server. Whenever I try to connect using Dns or Ip does not connect, if I use LocalHost, 127.0.0.1, it connects perfectly. It can already "resolve" the DNS IP What do I need to do...
asked by 26.07.2018 / 07:29
1
answer

Dns.Resolve () vs Dns.GetHostEntry ()

The Resolve method is obsolete, and Microsoft directs you to use GetHostEntry . However when using GetHostEntry the exception occurs:    This host is not known When I use Resolve there is no exception and the pr...
asked by 17.08.2016 / 17:09
1
answer

How to handle events in C #

Using the "TcpListener" class I'm "listening" for a port where multiple clients will connect. So peaceful. In order to receive data from a client I used a Thread that generates an event whenever any data is received. However when creating the ev...
asked by 08.03.2018 / 19:46
1
answer

Socket.BeginSend Using lots of cpu

I have an online gaming server and I have 600 online users, but the cpu is a bit high (using 10 ~ 20% of 26GHz) and the profiler says that this line is using many features Socket.BeginSend(packet, 0, packet.Length, 0, OnSendCompleted, null);...
asked by 28.12.2017 / 06:35