Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Сети";
Текущий архив: 2003.11.13;
Скачать: [xml.tar.bz2];

Вниз

ErrorCode (ClientSocket)   Найти похожие ветки 

 
Dennisius   (2003-09-12 10:40) [0]

procedure TForm.ClientSocket1Error(Sender: TObject;
Socket: TCustomWinSocket; ErrorEvent: TErrorEvent;
var ErrorCode: Integer);

Здрасте, а как получить текстовую форму: ErrorCode;
помоему была какая-то функция, но я не помню

TErrorEvent - че за класс такой я его в хелпе не нашел :)


 
mrcat   (2003-09-12 11:13) [1]

>TErrorEvent - че за класс такой я его в хелпе не нашел :)

The type for event handlers that respond when a Windows socket reports an error.

Unit

ScktComp

type

TErrorEvent = (eeGeneral, eeSend, eeReceive, eeConnect, eeDisconnect, eeAccept);

TSocketErrorEvent = procedure (Sender: TObject; Socket: TCustomWinSocket; ErrorEvent: TErrorEvent; var ErrorCode: Integer) of object;

Description

The Sender parameter is the socket component that encountered the error.

The Socket parameter is the TCustomWinSocket object that receives the error notification.

The ErrorCode parameter is the error code returned by the Windows socket API call. Changing this to 0 within an error handler prevents an exception from being raised.

The ErrorEvent parameter indicates what Socket was attempting to do when the error occurred. It is of type TErrorEvent, which can have any of the following values:

Value Meaning

eeGeneral The socket received an error message that does not fit into any of the following categories.
eeSend An error occurred when trying to write to the socket connection.
eeReceive An error occurred when trying to read from the socket connection.
eeConnect A connection request that was already accepted could not be completed.
eeDisconnect An error occurred when trying to close a connection.
eeAccept A problem occurred when trying to accept a client connection request.


---
>как получить текстовую форму: ErrorCode
SysErrorMessage ?


 
Digitman   (2003-09-12 12:42) [2]

никак

делай свой собственный дешифратор на основе констант-кодов ошибок, декларированных в модуле Winsock.pas


 
mrcat   (2003-09-12 12:54) [3]

Digitman © (12.09.03 12:42)

Странно. SysErrorMessage выдаёт вполне осмысленные сообщения :(


 
Digitman   (2003-09-12 13:09) [4]


> mrcat


приведи пример
это может работать не на всех платформах или работать некорректно
в противном случае этим давно бы воспользовался Борланд, как известно - старательно придерживающийся устойчивых платформ/версий/технологий


 
mrcat   (2003-09-12 13:32) [5]

Digitman © (12.09.03 13:09)
---
procedure TfrmWSA.btnCheckWSACodesClick(Sender: TObject);
const
WSAErrorCodes: array[0..39] of Integer = (
10004, 10013, 10014, 10022, 10024, 10035,
10036, 10037, 10038, 10039, 10040, 10042,
10044, 10045, 10046, 10047, 10048, 10049,
10050, 10051, 10052, 10053, 10054, 10055,
10056, 10057, 10058, 10060, 10061, 10064,
10065, 10067, 10091, 10092, 10093, 10094,
11001, 11002, 11003, 11004);
var
WSAIdx: Integer;

begin
for WSAIdx := Low(WSAErrorCodes) to High(WSAErrorCodes) do
moWSACompare.Lines.Add(Format("[%d]: %s", [WSAErrorCodes[WSAIdx],
SysErrorMessage(WSAErrorCodes[WSAIdx])]));
end;
---
[10004]: Операция блокирования прервана вызовом WSACancelBlockingCall
[10013]: Сделана попытка доступа к сокету методом, запрещенным правами доступа
[10014]: Система обнаружила недопустимый указатель адреса при попытке использовать в вызове аргумент указателя
[10022]: Получен недопустимый аргумент
[10024]: Открыто слишком много сокетов
[10035]: Операция на незаблокированном сокете не может быть завершена немедленно
[10036]: Сейчас выполняется операция блокировки
[10037]: На незаблокированном сокете сделана попытка выполнить операцию при наличии другой выполняемой операции
[10038]: Сделана попытка выполнить операцию на объекте, не являющемся сокетом
[10039]: В операции на сокете пропущен обязательный адрес
[10040]: Сообщение, отправленное на сокет датаграмм, было больше, чем буфер внутренних сообщений или был превышен иной сетевой параметр. Также возможно, что буфер для принятия сообщения был меньше, чем размер сообщения
[10042]: Для вызова getsockopt или setsockopt был указан неизвестный, недопустимый или неподдерживаемый параметр или уровень
[10044]: Поддержка указанного типа сокетов в этом семействе адресов отсутствует
[10045]: Предпринятая операция не поддерживается для выбранного типа объекта
[10046]: Данное семейство протоколов не настроено в системе, или оно не реализовано
[10047]: Адрес несовместим с выбранным протоколом
[10048]: Обычно разрешается одно использование адреса сокета (протокол/сетевой адрес/порт)
[10049]: Требуемый адрес для своего контекста неверен
[10050]: Операция на сокете обнаружила отключение сети
[10051]: Сделана попытка выполнить операцию на сокете при отключенной сети
[10052]: Подключение было разорвано из-за ошибки во время выполнения операции
[10053]: Программа на вашем хост-компьютере разорвала установленное подключение
[10054]: Удаленный хост принудительно разорвал существующее подключение
[10055]: Невозможно выполнить операцию на сокете, т.к. буфер слишком мал или очередь переполнена
[10056]: Сделан запрос на подключение для уже подключенного сокета
[10057]: Запрос на отправку или получение данных (when sending on a datagram socket using a sendto call) no address was supplied
[10058]: Запрос на отправку или получение данных был запрещен, т.к. сокет уже отключен в данном направлении на основании прежней запроса на его отключение
[10060]: Попытка установить соединение была безуспешной, т.к. от другого компьютера за требуемое время не получен нужный отклик, или было разорвано уже установленное соединение из-за неверного отклика уже подключенного компьютера
[10061]: Подключение не установлено, т.к. конечный компьютер отверг запрос на подключение
[10064]: Произошла ошибка операции на сокете, т.к. конечный хост выключен
[10065]: Сделана попытка выполнить операцию на сокете для недоступного хоста
[10067]: Реализация Windows Sockets может иметь ограничения на количество одновременно выполняющихся приложений
[10091]: WSAStartup не может выполняться в данное время, т.к. недоступна основная система, используемая для работы сетевых служб
[10092]: Указанная версия Windows Sockets не поддерживается
[10093]: Или приложение не вызвало WSAStartup, или произошла ошибка в WSAStartup
[10094]:
[11001]: Этот хост неизвестен
[11002]: Обычно - это временная ошибка, возникающая во время разрешения имени узла, и означающая, что локальный сервер не получил ответа от заслуживающего доверие сервера
[11003]: При просмотре базы данных произошла неисправимая ошибка
[11004]: Затребованное имя допустимо и оно найдено в базе данных,
но для имени отсутствуют связанные с ним данные, которые были разрешены для него


 
Digitman   (2003-09-12 13:47) [6]

это ты на какой платформе тестировал ?


 
mrcat   (2003-09-12 13:56) [7]

W2K, XP
на остальных не пробовал --- необходимости пока не было.


 
mrcat   (2003-09-12 14:34) [8]

Digitman © (12.09.03 13:09) [4]

>это может работать не на всех платформах или работать некорректно
в противном случае этим давно бы воспользовался Борланд, как известно - старательно придерживающийся устойчивых платформ/версий/технологий


Вы правы !
спец. NT4 поставил --- засада ! Сообщений по коду нема :(


 
panov   (2003-09-12 14:38) [9]

Я для себя написал функцию специально.

Функция примерно такая:

function GetError(const ErrorCode: DWORD): String;
var
i: DWORD;
begin
Result := "Not found error code";
for i := Low(ErrCode) to High(ErrCode) do
begin
if ErrorCode= ErrCode[i] then
begin
Result := ErrText[i];
Exit;
end;
end;
end;


в отдельном модуле:

const ErrCode: array[1..90] of Integer=(
10004,10009,10013,10014,10022,10024,10035,10036,
10037,10038,10039,10040,10041,10042,10043,10044,
10045,10046,10047,10048,10049,10050,10051,10052,
10053,10054,10055,10056,10057,10058,10059,10060,
10061,10062,10063,10064,10065,10066,10067,10068,
10069,10070,10071,10091,10092,10093,10101,10102,
10103,10104,10105,10106,10107,10108,10109,10110,
10111,10112,11001,11002,11003,11004,11005,11006,
11007,11008,11009,11010,11011,11012,11013,11014,
11015,11016,11017,11018,11019,11020,11021,11022,
11023,11024,11025,11026,11027,11028,11029,11030,
11031,
const WSAEINTR =10004;
const WSAEBADF =10009;
const WSAEACCES =10013;
const WSAEFAULT =10014;
const WSAEINVAL =10022;
const WSAEMFILE =10024;
const WSAEWOULDBLOCK =10035;
const WSAEINPROGRESS =10036;
const WSAEALREADY =10037;
const WSAENOTSOCK =10038;
const WSAEDESTADDRREQ =10039;
const WSAEMSGSIZE =10040;
const WSAEPROTOTYPE =10041;
const WSAENOPROTOOPT =10042;
const WSAEPROTONOSUPPORT =10043;
const WSAESOCKTNOSUPPORT =10044;
const WSAEOPNOTSUPP =10045;
const WSAEPFNOSUPPORT =10046;
const WSAEAFNOSUPPORT =10047;
const WSAEADDRINUSE =10048;
const WSAEADDRNOTAVAIL =10049;
const WSAENETDOWN =10050;
const WSAENETUNREACH =10051;
const WSAENETRESET =10052;
const WSAECONNABORTED =10053;
const WSAECONNRESET =10054;
const WSAENOBUFS =10055;
const WSAEISCONN =10056;
const WSAENOTCONN =10057;
const WSAESHUTDOWN =10058;
const WSAETOOMANYREFS =10059;
const WSAETIMEDOUT =10060;
const WSAECONNREFUSED =10061;
const WSAELOOP =10062;
const WSAENAMETOOLONG =10063;
const WSAEHOSTDOWN =10064;
const WSAEHOSTUNREACH =10065;
const WSAENOTEMPTY =10066;
const WSAEPROCLIM =10067;
const WSAEUSERS =10068;
const WSAEDQUOT =10069;
const WSAESTALE =10070;
const WSAEREMOTE =10071;
const WSASYSNOTREADY =10091;
const WSAVERNOTSUPPORTED =10092;
const WSANOTINITIALISED =10093;
const WSAEDISCON =10101;
const WSAENOMORE =10102;
const WSAECANCELLED =10103;
const WSAEINVALIDPROCTABLE =10104;
const WSAEINVALIDPROVIDER =10105;
const WSAEPROVIDERFAILEDINIT =10106;
const WSASYSCALLFAILURE =10107;
const WSASERVICE_NOT_FOUND =10108;
const WSATYPE_NOT_FOUND =10109;
const WSA_E_NO_MORE =10110;
const WSA_E_CANCELLED =10111;
const WSAEREFUSED =10112;
const WSAHOST_NOT_FOUND =11001;
const WSATRY_AGAIN =11002;
const WSANO_RECOVERY =11003;
const WSANO_DATA =11004;
const WSA_QOS_RECEIVERS =11005;
const WSA_QOS_SENDERS =11006;
const WSA_QOS_NO_SENDERS =11007;
const WSA_QOS_NO_RECEIVERS =11008;
const WSA_QOS_REQUEST_CONFIRMED =11009;
const WSA_QOS_ADMISSION_FAILURE =11010;
const WSA_QOS_POLICY_FAILURE =11011;
const WSA_QOS_BAD_STYLE =11012;
const WSA_QOS_BAD_OBJECT =11013;
const WSA_QOS_TRAFFIC_CTRL_ERROR=11014;
const WSA_QOS_GENERIC_ERROR =11015;
const WSA_QOS_ESERVICETYPE =11016;
const WSA_QOS_EFLOWSPEC =11017;
const WSA_QOS_EPROVSPECBUF =11018;
const WSA_QOS_EFILTERSTYLE =11019;
const WSA_QOS_EFILTERTYPE =11020;
const WSA_QOS_EFILTERCOUNT =11021;
const WSA_QOS_EOBJLENGTH =11022;
const WSA_QOS_EFLOWCOUNT =11023;
const WSA_QOS_EUNKOWNPSOBJ =11024;
const WSA_QOS_EPOLICYOBJ =11025;
const WSA_QOS_EFLOWDESC =11026;
const WSA_QOS_EPSFLOWSPEC =11027;
const WSA_QOS_EPSFILTERSPEC =11028;
const WSA_QOS_ESDMODEOBJ =11029;
const WSA_QOS_ESHAPERATEOBJ =11030;
const WSA_QOS_RESERVED_PETYPE =11031;


 
panov   (2003-09-12 14:38) [10]

"A blocking operation was interrupted by a call to WSACancelBlockingCall.",
"The file handle supplied is not valid.",
"An attempt was made to access a socket in a way forbidden by its access permissions.",
"The system detected an invalid pointer address in attempting to use a pointer argument in a call.",
"An invalid argument was supplied.",
"Too many open sockets.",
"A non-blocking socket operation could not be completed immediately.",
"A blocking operation is currently executing.",
"An operation was attempted on a non-blocking socket that already had an operation in progress.",
"An operation was attempted on something that is not a socket.",
"A required address was omitted from an operation on a socket.",
"A message sent on a datagram socket was larger than the internal message buffer or some other network limit, or the buffer used to receive a datagram into was smaller than the datagram itself.",
"A protocol was specified in the socket function call that does not support the semantics of the socket type requested.",
"An unknown, invalid, or unsupported option or level was specified in a getsockopt or setsockopt call.",
"The requested protocol has not been configured into the system, or no implementation for it exists.",
"The support for the specified socket type does not exist in this address family.",
"The attempted operation is not supported for the type of object referenced.",
"The protocol family has not been configured into the system or no implementation for it exists.",
"An address incompatible with the requested protocol was used.",
"Only one usage of each socket address (protocol/network address/port) is normally permitted.",
"The requested address is not valid in its context.",
"A socket operation encountered a dead network.",
"A socket operation was attempted to an unreachable network.",
"The connection has been broken due to keep-alive activity detecting a failure while the operation was in progress.",
"An established connection was aborted by the software in your host machine.",
"An existing connection was forcibly closed by the remote host.",
"An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full.",
"A connect request was made on an already connected socket.",
"A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied.",
"A request to send or receive data was disallowed because the socket had already been shut down in that direction with a previous shutdown call.",
"Too many references to some kernel object.",
"A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.",
"No connection could be made because the target machine actively refused it.",
"Cannot translate name.",
"Name component or name was too long.",
"A socket operation failed because the destination host was down.",
"A socket operation was attempted to an unreachable host.",
"Cannot remove a directory that is not empty.",
"A Windows Sockets implementation may have a limit on the number of applications that may use it simultaneously.",
"Ran out of quota.",
"Ran out of disk quota.",
"File handle reference is no longer available.",
"Item is not available locally.",
"WSAStartup cannot function at this time because the underlying system it uses to provide network services is currently unavailable.",
"The Windows Sockets version requested is not supported.",
"Either the application has not called WSAStartup, or WSAStartup failed.",
"Returned by WSARecv or WSARecvFrom to indicate the remote party has initiated a graceful shutdown sequence.",
"No more results can be returned by WSALookupServiceNext.",
"A call to WSALookupServiceEnd was made while this call was still processing. The call has been canceled.",
"The procedure call table is invalid.",
"The requested service provider is invalid.",
"The requested service provider could not be loaded or initialized.",
"A system call that should never fail has failed.",
"No such service is known. The service cannot be found in the specified name space.",
"The specified class was not found.",
"No more results can be returned by WSALookupServiceNext.",
"A call to WSALookupServiceEnd was made while this call was still processing. The call has been canceled.",
"A database query failed because it was actively refused.",
"No such host is known.",
"This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server.",
"A non-recoverable error occurred during a database lookup.",
"The requested name is valid, but no data of the requested type was found.",
"At least one reserve has arrived.",
"At least one path has arrived.",
"There are no senders.",
"There are no receivers.",
"Reserve has been confirmed.",
"Error due to lack of resources.",
"Rejected for administrative reasons - bad credentials.",
"Unknown or conflicting style.",
"Problem with some part of the filterspec or providerspecific buffer in general.",
"Problem with some part of the flowspec.",
"General QOS error.",
"An invalid or unrecognized service type was found in the flowspec.",
"An invalid or inconsistent flowspec was found in the QOS structure.",
"Invalid QOS provider-specific buffer.",
"An invalid QOS filter style was used.",
"An invalid QOS filter type was used.",
"An incorrect number of QOS FILTERSPECs were specified in the FLOWDESCRIPTOR.",
"An object with an invalid ObjectLength field was specified in the QOS provider-specific buffer.",
"An incorrect number of flow descriptors was specified in the QOS structure.",
"An unrecognized object was found in the QOS provider-specific buffer.",
"An invalid policy object was found in the QOS provider-specific buffer.",
"An invalid QOS flow descriptor was found in the flow descriptor list.",
"An invalid or inconsistent flowspec was found in the QOS provider specific buffer.",
"An invalid FILTERSPEC was found in the QOS provider-specific buffer.",
"An invalid shape discard mode object was found in the QOS provider specific buffer.",
"An invalid shaping rate object was found in the QOS provider-specific buffer.",
"A reserved policy element was found in the QOS provider-specific buffer.",


 
Digitman   (2003-09-12 14:39) [11]

об чем и речь)

так что универс.решение - сотворить свой собственный "декодер"



Страницы: 1 вся ветка

Форум: "Сети";
Текущий архив: 2003.11.13;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.51 MB
Время: 0.22 c
1-41577
Furkan
2003-10-27 13:35
2003.11.13
MDI и scroll


6-41819
Alex21
2003-09-12 12:40
2003.11.13
Как отследить вход в мой компьютер друго пользователя


1-41275
han-bratan
2003-10-31 15:09
2003.11.13
Отображение формы


3-41064
Denisiy
2003-10-23 18:38
2003.11.13
Как отследить изменение ширины столбца DBgrid a?


7-42175
Anonimus
2003-08-29 18:45
2003.11.13
помогите разобраться с сом-портом





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский