Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2004.10.03;
Скачать: CL | DM;

Вниз

Проблема отправики потока данных в сокет   Найти похожие ветки 

 
BJValentine   (2004-07-23 11:50) [0]

На сервере:


{Обработчик 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. Где искать собаку?


 
MetalFan ©   (2004-07-23 17:31) [1]

и что за сокет???
может из-за этого:
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.


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

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


 
Reindeer Moss Eater ©   (2004-07-23 17:58) [3]

The Windows socket object frees the stream when it is finished with it.


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

СпасиБО!



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

Текущий архив: 2004.10.03;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.037 c
1-1095742175
OlegM
2004-09-21 08:49
2004.10.03
Как из потока данные загнать в переменную типа string?


1-1095379519
Knapp
2004-09-17 04:05
2004.10.03
как сделать так, чтобы при нажати на клавишу Tab ...


3-1094111059
Iconka
2004-09-02 11:44
2004.10.03
Транзакции в FIBPlus (БД FireBird 1.5)


14-1095068974
VID
2004-09-13 13:49
2004.10.03
Ищу фулфлэш для Siemens S45i


14-1095016210
Vasya.ru
2004-09-12 23:10
2004.10.03
Не пойму логики кода