![]() |
![]() |
![]() ![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 86 Pomógł: 0 Dołączył: 27.05.2004 Skąd: Zielona Góra Ostrzeżenie: (0%) ![]() ![]() |
Witam!
Łącze się z napisanym przez siebie serwerem w sposób:
Przy połączeniu niemam problemów z odbieraniem danych bo wiem ile maja znaków (27 - "WITAM - Połączenie otwarte"). Tak samo wysyłając zapytanie TIME. Niestety niewszystkie odpowiedzi będą miały ściśle określona liczbę znaków, będzie ona dowolna (zależna od zawartości jakiegos pliku). Moje dokładne pytanie to Jak pobrać wielkość aktualnie odebranej linijki z danymi (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif) Prosze o pomoc |
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 1 597 Pomógł: 30 Dołączył: 19.02.2003 Skąd: Tychy Ostrzeżenie: (0%) ![]() ![]() |
Cytat Note: The length parameter became optional in php 4.2.0, if omitted, it would assume 1024 as the line length. As of php 4.3, omitting length will keep reading from the stream until it reaches the end of the line. If the majority of the lines in the file are all larger than 8KB, it is more resource efficient for your script to specify the maximum line length.
|
|
|
![]()
Post
#3
|
|
Grupa: Zarejestrowani Postów: 86 Pomógł: 0 Dołączył: 27.05.2004 Skąd: Zielona Góra Ostrzeżenie: (0%) ![]() ![]() |
Cytat(sf @ 2004-08-11 23:57:02) Cytat Note: The length parameter became optional in php 4.2.0, if omitted, it would assume 1024 as the line length. As of php 4.3, omitting length will keep reading from the stream until it reaches the end of the line. If the majority of the lines in the file are all larger than 8KB, it is more resource efficient for your script to specify the maximum line length. Wiele mi to niemówi :/ (IMG:http://forum.php.pl/style_emoticons/default/sad.gif) |
|
|
![]()
Post
#4
|
|
Grupa: Zarejestrowani Postów: 19 Pomógł: 0 Dołączył: 13.08.2004 Skąd: Łódź Ostrzeżenie: (0%) ![]() ![]() |
Cytat(Szakal @ 2004-08-12 14:06:05) Cytat(sf @ 2004-08-11 23:57:02) Cytat Note: The length parameter became optional in php 4.2.0, if omitted, it would assume 1024 as the line length. As of php 4.3, omitting length will keep reading from the stream until it reaches the end of the line. If the majority of the lines in the file are all larger than 8KB, it is more resource efficient for your script to specify the maximum line length. Wiele mi to niemówi :/ (IMG:http://forum.php.pl/style_emoticons/default/sad.gif) Parametr długości od php 4.2.0 jest(stał się - jak kto woli (IMG:http://forum.php.pl/style_emoticons/default/tongue.gif) ) optymalny(czytaj nie musisz go podawać!), jeśli go pominiemy będzie miał wartość 1024. Od php 4.3 jeżeli pominiemy parametr, php będzie czytało przekaz dopóki nie wyciągnie końca lini(wszyscy wiemy oco chodzi (IMG:http://forum.php.pl/style_emoticons/default/tongue.gif) ) to mnie ciekawi: If the majority of the lines in the file are all larger than 8KB jeśli większość lini w twoim pliku jest większa niż 8KB(wydawało mi się, że mówimy o socketach a nie plikach (IMG:http://forum.php.pl/style_emoticons/default/graduated.gif) ) lepiej podać max. długość linii... coś mi się wydaje, że ten cały quote był o plikach [dop. do posta poniżej] ano można o tym nie pomyślałem, przecież funkcja może mieć wiele `funkcji` (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) bye Ten post edytował darkspirit 13.08.2004, 17:41:29 |
|
|
![]()
Post
#5
|
|
Grupa: Zarejestrowani Postów: 657 Pomógł: 2 Dołączył: 15.08.2003 Skąd: Łódź Ostrzeżenie: (0%) ![]() ![]() |
bo przez fgets można pobierać dane z plików, z socketa albo nawet z stdin
|
|
|
![]() ![]() |
![]() |
Aktualny czas: 22.08.2025 - 22:27 |