Top.Mail.Ru
Мастера DELPHI, Delphi programming community Титульная страница Поиск, карта сайта Написать письмо 
| Новости | Поиск | FAQ | Статьи | Книги | Новости VCL |
| Форумы ЧАТ | Орешник | KOL и MCK |
Форумы -» Основная («Начинающим»)/ Базы / WinAPI / Компоненты / Сети / Media / Игры / Corba и COM / KOL / FreePascal / .Net / Прочее / RSDN.ORG

« предыдущая ветвь | форум | следующая ветвь »

Проблема отправики потока данных в сокет [D5, Win2k]


BJValentine ©   (2004-07-23 11:50:00) 

На сервере:


{Обработчик OnClientRead}
              FS:=TFileStream.Create('temp\1.rar',fmOpenRead);
              FS.Position:=StrToInt(Par);
              if Socket.SendStream(FS) then DeleteFile('temp\1.rar');
              FS.Free;


Socket.SendStream(FS) возвращает false, После выхода из обработчика события выдаёт ошибку Access Violation. Где искать собаку?


BJValentine   (2004-07-23 18:45:00) [1]

СпасиБО!


Reindeer Moss Eater   (2004-07-23 17:58:00) [2]

The Windows socket object freesthe stream when it is finished with it.


BJValentine   (2004-07-23 17:52:00) [3]

Да, но если его не освобождать, то как же с ним быть если он становится не нужным? Как правильно?


MetalFan   (2004-07-23 17:31:00) [4]

и что за сокет???
может из-за этого:
Writes all the information that can be read from the AStream parameter to the socket connection.

function SendStream(AStream: TStream): Boolean;

Description

.....

Note: The Stream passed as a parameter to SendStream becomes “owned” by the windows socket object.  The Windows socket object frees the stream when it is finished with it.   Do not attempt to free the stream after it has been passed as a parameter.


Наверх

Титульная страница Поиск, карта сайта Написать письмо