Skip to main content

Questions tagged [connection]

Refers to a connection used to transfer data between two endpoints, such as between a client and a web, database, web service or other server.

Filter by
Sorted by
Tagged with
460 votes
5 answers
407k views

How do multiple clients connect simultaneously to one port, say 80, on a server? [duplicate]

I understand the basics of how ports work. However, what I don't get is how multiple clients can simultaneously connect to say port 80. I know each client has a unique (for their machine) port. Does ...
IamIC's user avatar
  • 18.1k
398 votes
22 answers
230k views

Artificially create a connection timeout error

I've had a bug in our software that occurs when I receive a connection timeout. These errors are very rare (usually when my connection gets dropped by our internal network). How can I generate this ...
Mark Ingram's user avatar
  • 73.1k
384 votes
16 answers
1.1m views

How to connect to MySQL from the command line

How can you connect to MySQL from the command line in a Mac? (i.e. show me the code) I'm doing a PHP/SQL tutorial, but it starts by assuming you're already in MySQL.
Leahcim's user avatar
  • 41.1k
361 votes
27 answers
808k views

Login to Microsoft SQL Server Error: 18456

I am getting this error while trying to connect to the SQL Server. Microsoft SQL Server Error: 18456 Can anybody tell me what the error code means?
merazuu's user avatar
  • 4,328
321 votes
9 answers
835k views

MySQL show status - active or total connections?

When I run show status like 'Con%' it shows the number of connections, which is 9972 and constantly growing. Is this an active number of connections or connections made in total?
Michael's user avatar
  • 3,619
270 votes
21 answers
457k views

No internet connection on WSL Ubuntu (Windows Subsystem for Linux) [closed]

Recently I installed WSL Ubuntu 18.04 on my Windows machine, but nothing seems to work properly, because I have no internet access. I tried a few commands and sudo apt update says 'Connection failed' ...
garzj's user avatar
  • 3,097
245 votes
2 answers
254k views

What is the difference between connection and read timeout for sockets?

3 questions: What is the difference between connection and read timeout for sockets? What does connection timeout set to "infinity" mean? In what situation can it remain in an infinitive loop? and ...
corgrath's user avatar
  • 12.1k
241 votes
2 answers
358k views

How to create user for a db in postgresql? [closed]

I have installed PostgreSQL 8.4 on my CentOS server and connected to root user from shell and accessing the PostgreSQL shell. I created the database and user in PostgreSQL. While trying to connect ...
user avatar
188 votes
22 answers
693k views

How do I start Mongo DB from Windows?

I have installed MongoDB on my Windows 7 (64 bit) machine. I have created the path data/db too but when I tried to start mongodb using the command 'C:\mongodb\bin\mongod.exe', it is not starting. It ...
user3095838's user avatar
  • 2,165
186 votes
17 answers
1.2m views

java.net.SocketException: Connection reset

I am getting the following error trying to read from a socket. I'm doing a readInt() on that InputStream, and I am getting this error. Perusing the documentation suggests that the client part of the ...
user avatar
167 votes
16 answers
388k views

How to detect the physical connected state of a network cable/connector?

In a Linux environment, I need to detect the physical connected or disconnected state of an RJ45 connector to its socket. Preferably using BASH scripting only. The following solutions which have ...
Jeach's user avatar
  • 8,942
160 votes
10 answers
163k views

Using R to download zipped data file, extract, and import data

@EZGraphs on Twitter writes: "Lots of online csvs are zipped. Is there a way to download, unzip the archive, and load the data to a data.frame using R? #Rstats" I was also trying to do this today, ...
Jeromy Anglim's user avatar
157 votes
16 answers
393k views

Python [Errno 98] Address already in use

In my Python socket program, I sometimes need to interrupt it with Ctrl-C. When I do this, it does close the connection using socket.close(). However, when I try to reopen it I have to wait what ...
skylerl's user avatar
  • 4,120
155 votes
8 answers
80k views

iPhone Simulator - Simulate a slow connection?

Is there a way to slow down the internet connection to the iPhone Simulator, so as to mimic how the App might react when you are in a slow spot on the cellular network?
Chris's user avatar
  • 5,577
155 votes
16 answers
447k views

"The underlying connection was closed: An unexpected error occurred on a send." With SSL Certificate

Issue I get this exception The underlying connection was closed: An unexpected error occurred on a send. in my logs, and it is breaking our OEM integration with our e-mail marketing system at random ...
Arvind Morwal's user avatar
153 votes
12 answers
243k views

Draw a connecting line between two elements [closed]

How can I draw a line between two or more elements to connect them? Any combination of HTML/CSS/JavaScript/SVG/Canvas is fine. If your answer supports any of these, then do mention it: draggable ...
Bakhtiyor's user avatar
  • 7,258
145 votes
24 answers
319k views

How to test an Internet connection with bash?

How can an internet connection be tested without pinging some website? I mean, what if there is a connection but the site is down? Is there a check for a connection with the world?
lauriys's user avatar
  • 4,742
137 votes
11 answers
511k views

How to grant remote access permissions to mysql server for user?

If I do SHOW GRANTS in my mysql database I get GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD 'some_characters' WITH GRANT OPTION If I am not mistaken, root@...
Aufwind's user avatar
  • 26k
129 votes
14 answers
228k views

How to create a bash script to check the SSH connection?

I am in the process of creating a bash script that would log into the remote machines and create private and public keys. My problem is that the remote machines are not very reliable, and they are ...
chutsu's user avatar
  • 13.9k
128 votes
23 answers
427k views

MySQL connection not working: 2002 No such file or directory

I'm trying to set up WordPress. I have Apache and MySQL running, and the accounts and database are all set up. I tried to make a simple connection: <?php $conn = mysql_connect('localhost', '...
mk12's user avatar
  • 26.1k
127 votes
20 answers
136k views

How to fix HttpException: Connection closed before full header was received

I have recently upgraded my flutter version in my app. But when I want to debug the application, it shows me the following error. Error connecting to the service protocol: HttpException: Connection ...
Juthi Sarker Aka's user avatar
112 votes
9 answers
358k views

How to determine total number of open/active connections in ms sql server 2005

My PHP/MS Sql Server 2005/win 2003 Application occasionally becomes very unresponsive, the memory/cpu usage does not spike. If i try to open any new connection from sql management studio, then the it ...
user avatar
110 votes
8 answers
232k views

How to close idle connections in PostgreSQL automatically?

Some clients connect to our postgresql database but leave the connections opened. Is it possible to tell Postgresql to close those connection after a certain amount of inactivity ? TL;DR IF you're ...
Stephan's user avatar
  • 42.6k
101 votes
15 answers
733k views

Setting up connection string in ASP.NET to SQL SERVER

I'm trying to set up a connecting string in my web.config file (Visual Studio 2008/ASP.NET 3.5) to a local server (SQL server 2008). In my web.config, how and where do I place the connection string? ...
Ray's user avatar
  • 3,429
94 votes
10 answers
544k views

Why would a "java.net.ConnectException: Connection timed out" exception occur when URL is up?

I'm getting a ConnectException: Connection timed out with some frequency from my code. The URL I am trying to hit is up. The same code works for some users, but not others. It seems like once one ...
Sarah Haskins's user avatar
90 votes
5 answers
52k views

How can I programmatically remove the 2 connection limit in WebClient

Those "fine" RFCs mandate from every RFC-client that they beware of not using more than 2 connections per host... Microsoft implemented this in WebClient. I know that it can be turned off with App....
Christian's user avatar
  • 2,947
89 votes
3 answers
91k views

How to close a mongodb python connection?

I'm doing a python script that writes some data to a mongodb. I need to close the connection and free some resources, when finishing. How is that done in Python?
lrente's user avatar
  • 1,100
89 votes
3 answers
80k views

In Java when does a URL connection close?

When does java let go of a connections to a URL? I don't see a close() method on either URL or URLConnection so does it free up the connection as soon as the request finishes? I'm mainly asking to see ...
timdisney's user avatar
  • 5,317
88 votes
15 answers
196k views

Instantly detect client disconnection from server socket

How can I detect that a client has disconnected from my server? I have the following code in my AcceptCallBack method static Socket handler = null; public static void AcceptCallback(IAsyncResult ar) ...
user avatar
86 votes
18 answers
147k views

Apache Server (xampp) doesn't run on Windows 10 (Port 80)

I have installed the Windows 10 Insider Program. Everything works, except Apache. When I try to start it, it says that port 80 is blocked. Is there a way to unblock it or tell Apache to use another ...
Aloso's user avatar
  • 5,311
84 votes
15 answers
393k views

mySQL Error 1040: Too Many Connection

How to fix these, "SQL Error 1040: Too Many Connection" even I try to put max_user_connection=500 still "Too many connection"
kelvzy's user avatar
  • 983
83 votes
11 answers
183k views

How to check if a socket is connected/disconnected in C#?

How can you check if a network socket (System.Net.Sockets.Socket) is still connected if the other host doesn't send you a packet when it disconnects (e.g. because it disconnected ungracefully)?
lesderid's user avatar
  • 3,431
79 votes
11 answers
71k views

AWS EC2 Connection closed by when trying ssh into instance

Recently I set up a new EC2 instance. The next day I was not able to connect to my instance via ssh. I could connect and disconnect the day before, I am sure I did nothing. Here is ssh debug info: ...
Victor Davydov's user avatar
78 votes
47 answers
648k views

Failed to connect to mysql at 127.0.0.1:3306 with user root access denied for user 'root'@'localhost'(using password:YES)

I've been trying to create a new database connection on workbench. However, every time I test a connection there is an error message that says Failed to connect to mysql at 127.0.0.1:3306 with user ...
cpl's user avatar
  • 781
78 votes
14 answers
118k views

How do I connect to mongodb with node.js (and authenticate)?

How do I connect to mongodb with node.js? I have the node-mongodb-native driver. There's apparently 0 documentation. Is it something like this? var mongo = require('mongodb/lib/mongodb'); var Db= ...
Mark's user avatar
  • 33.1k
77 votes
7 answers
281k views

How to kill MySQL connections

I'm building a website with MySQL. I'm using TOAD for MySQL and suddenly I can't connect to the database as I'm getting an error: "Too many connections" Is there any way in Toad for MySQL to view ...
leora's user avatar
  • 194k
75 votes
34 answers
605k views

java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)

The following code: Class.forName("com.mysql.jdbc.Driver"); Connection m_connection = DriverManager.getConnection("jdbc:mysql://localhost","root","root"); Throws this exception on getConnection(): ...
JAN's user avatar
  • 21.7k
74 votes
12 answers
156k views

HttpClient 4.0.1 - how to release connection? [duplicate]

I have a loop over a bunch of URLs, for each one I'm doing the following: private String doQuery(String url) { HttpGet httpGet = new HttpGet(url); setDefaultHeaders(httpGet); // static method ...
Richard H's user avatar
  • 38.8k
74 votes
12 answers
78k views

How do I shut down a Node.js http(s) server immediately?

I have a Node.js application that contains an http(s) server. In a specific case, I need to shut down this server programmatically. What I am currently doing is calling its close() function, but this ...
Golo Roden's user avatar
  • 147k
73 votes
18 answers
132k views

How to check if internet connection is present in Java?

How do you check if you can connect to the internet via java? One way would be: final URL url = new URL("http://www.google.com"); final URLConnection conn = url.openConnection(); ... if we got here, ...
Chris's user avatar
  • 15.5k
72 votes
2 answers
93k views

urllib3 connectionpool - Connection pool is full, discarding connection

Does seeing the urllib3.connectionpool WARNING - Connection pool is full, discarding connection mean that I am effectively loosing data (because of lost connection) OR Does it mean that connection ...
JavaFan's user avatar
  • 1,415
69 votes
2 answers
55k views

How to increase the timeout for `yarn install`

I'm currently using Yarn on a very unstable internet connection. Sometimes it takes hours until I can finally download all the packages. I noticed Yarn retries the download when there is some kind of ...
Fabio K's user avatar
  • 1,374
69 votes
7 answers
143k views

Cannot connect to MySQL 4.1+ using old authentication

I'm trying to connect to a mySQL database at http://bluesql.net, but when I try to connect, it gives this error: Connect Error (2000) mysqlnd cannot connect to MySQL 4.1+ using old authentication I'...
B T's user avatar
  • 59.8k
67 votes
7 answers
42k views

Hibernate Slow to Acquire Postgres Connection

I'm having a really difficult time debugging this problem. Whenever I try to establish a connection with postgres, it takes a whole minute. After the connection is established, everything is fine. I'...
Jason Huntley's user avatar
64 votes
2 answers
41k views

Is it safe to use a static java.sql.Connection instance in a multithreaded system?

I'm running a web application on Tomcat. I have a class that handles all DB queries. This class contains the Connection object and methods that returns query results. This is the connection object: ...
Asher Saban's user avatar
  • 4,763
62 votes
3 answers
144k views

What is the functionality of setSoTimeout and how it works?

I'm trying to learn Socket and I'm confused by following text from Oracle's website: setSoTimeout public void setSoTimeout(int timeout) throws SocketException Enable/disable SO_TIMEOUT with the ...
Bernard's user avatar
  • 4,420
61 votes
4 answers
100k views

Android event for internet connectivity state change [duplicate]

I am making an app where a user is uploading information and files to my server on a somewhat frequent basis. This is done in new threads through a dedicated uploader service. I know from this ...
akhalsa's user avatar
  • 2,313
61 votes
7 answers
57k views

How to limit speed of internet connection on Android emulator?

I need to test app for work with slow internet connection. How to simulate slow internet connection on Android emulator?
mobiledev Alex's user avatar
61 votes
11 answers
241k views

Oracle - What TNS Names file am I using?

Sometimes I get Oracle connection problems because I can't figure out which tnsnames.ora file my database client is using. What's the best way to figure this out? ++happy for various platform ...
Mark Harrison's user avatar
58 votes
15 answers
375k views

CodeIgniter: Unable to connect to your database server using the provided settings Error Message

I have been using CI just fine using the MySQL driver. I want to use the MySQL driver instead, but as soon as I change it (just add the ‘i’ at the end of MySQL, and added the port number) I get the ...
Onema's user avatar
  • 7,532

1
2 3 4 5
206