FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
Herramientas | Buscar en Tema | Desplegado |
#1
|
|||
|
|||
Como mandar archivos por SOCKET en Delphi 7
Como mandar archivos por SOCKET en Delphi 7 ?,
no se utilizar el commando de SendBuf() y RecibeBuf(), alguien me puede explicar porque de verdad no entiendo!!!! |
#2
|
||||
|
||||
Un ejemplo con hilos de la API de GUINDOWS
Te muestro el ejemplo en Builder, los componentes usados los ha de tener también el Delphi, corres el servidor una vez y el cliente cuantas veces quieras, en el primer Edit das el ip de donde esta el servidor y luego clickeas en conectar y mas nada, ahi van el .cpp, .h, .dfm
El SendBuf y el ReceiveBuf transfieren (por decirlo así) bloques de bytes del tamaño dado en su segundo parámetro, el buffer o bloque es una referencia cualquiera (excepto punteros a funciones y a archivos), en C el puntero genérico es void *, en Pascal no recuerdo ahorita si es Pointer o algo así, simplemente mandas la dirección del bloque q has de enviar y cuanto has de enviar, si trabajas con envio de archivos consulta por NMStrmServ y NMStrm, ellos envían flujos de tamaño considerable y la velocidad es bestial (de hecho...vuelan!!) Última edición por vtdeleon fecha: 15-03-2007 a las 05:48:55. |
#3
|
|||
|
|||
De cuasualidad no tendrá alguien este codigo pero en Delphi, seria muiy bueno para los que no sabemos absolutamente nada de C.
Saludos. |
#4
|
||||
|
||||
No hace falta ir directamente al API para enviar un archivo por sockets, aunque si queres hacerlo de esta forma, pues francamente tampoco hay que te lo impida.
Para enviar ficheros, podes valerte de las INDY, en particular de TidTCPServer e TidTCPClient. Hasta lugeo.
__________________
Juan Antonio Castillo Hernández (jachguate) Guía de Estilo | Etiqueta CODE | Búsca antes de preguntar | blog de jachguate |
#5
|
|||
|
|||
Tus dudas estan en este hilo!
|
|
|
|