- Link* MyLink;
-
- switch (e)
- {
- case I_ERR_CONNECT:
- Utils->Creator->RemoteMessage(NULL,"Connection failed: Connection to \002%s\002 refused", myhost.c_str());
- MyLink = Utils->FindLink(myhost);
- if (MyLink)
- Utils->DoFailOver(MyLink);
- break;
- case I_ERR_SOCKET:
- Utils->Creator->RemoteMessage(NULL,"Connection failed: Could not create socket (%s)", strerror(errno));
- break;
- case I_ERR_BIND:
- Utils->Creator->RemoteMessage(NULL,"Connection failed: Error binding socket to address or port (%s)", strerror(errno));
- break;
- case I_ERR_WRITE:
- Utils->Creator->RemoteMessage(NULL,"Connection failed: I/O error on connection (%s)", strerror(errno));
- break;
- case I_ERR_NOMOREFDS:
- Utils->Creator->RemoteMessage(NULL,"Connection failed: Operating system is out of file descriptors!");
- break;
- default:
- if ((errno) && (errno != EINPROGRESS) && (errno != EAGAIN))
- Utils->Creator->RemoteMessage(NULL,"Connection to \002%s\002 failed with OS error: %s", myhost.c_str(), strerror(errno));
- break;
- }
-}
-
-int TreeSocket::OnDisconnect()
-{
- /* For the same reason as above, we don't
- * handle OnDisconnect()
- */
- return true;
+ ServerInstance->SNO->WriteGlobalSno('l', "Connection to '\002%s\002' failed with error: %s",
+ linkID.c_str(), getError().c_str());
+ LinkState = DYING;