Вниз
Скачать: 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 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.035 c
4-1093446638
noname
2004-08-25 19:10
2004.10.03
Драйвер на Delphi!


6-1090870617
SergeE
2004-07-26 23:36
2004.10.03
Перехват обращений к интернет


14-1095076964
Мюмзик
2004-09-13 16:02
2004.10.03
дороже не лучше


3-1094024391
Koala
2004-09-01 11:39
2004.10.03
Клиент-сервер (MIDAS) под Firebird 1.5


4-1092872191
RyDmi
2004-08-19 03:36
2004.10.03
Копия программы




   Наверх