Hey,looking at the functionality of [tcpclient] and [tcpserver] objects, I see there is a way to "send a file" through the TCP connection. What does this means? could you effectively send files from the filesystem? if so, where are them expected to be stored by the other end?It looks exciting but I didn't manage to send anything but numbers yet...no real files. Maybe I didn't undestand it? Josep M
On 09/05/11 11:10 AM, Jeppi Jeppi wrote:
Hey, looking at the functionality of [tcpclient] and [tcpserver] objects, I see there is a way to "send a file" through the TCP connection. What does this means? could you effectively send files from the filesystem? if so, where are them expected to be stored by the other end? It looks exciting but I didn't manage to send anything but numbers yet...no real files. Maybe I didn't undestand it?
If the data you're sending is a symbol instead of numbers, the symbol will be interpreted as a file name, so [client 1 hello.jpg( will send hello.jpg as raw bytes. The other end will just receive the raw bytes, so it would need to know what to do with it. I made a pair of [httpreq] and [httpreceive] objects that will work together with [tcpserver] and [tcpclient] to simplify http requests and reception on (usually) port 80. I still need to make a [packhttp] object that will send stuff with the proper header.
Martin
On Mon, 9 May 2011, Martin wrote:
If the data you're sending is a symbol instead of numbers, the symbol will be interpreted as a file name, so [client 1 hello.jpg( will send hello.jpg as raw bytes.
Is that name relative to the "current folder", or the patch's folder, or the folders in the Path dialogue, or all, or whatever else ?
| Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC
On 09/05/11 01:31 PM, Mathieu Bouchard wrote:
On Mon, 9 May 2011, Martin wrote:
If the data you're sending is a symbol instead of numbers, the symbol will be interpreted as a file name, so [client 1 hello.jpg( will send hello.jpg as raw bytes.
Is that name relative to the "current folder", or the patch's folder, or the folders in the Path dialogue, or all, or whatever else ?
It opens the file relative to the folder containing [tcpserver] (it calls fopen with whatever path you give it). You can also give it an absolute path.
Martin
On Mon, 9 May 2011, Martin wrote:
It opens the file relative to the folder containing [tcpserver] (it calls fopen with whatever path you give it).
Isn't that only because you start pd from the folder containing [tcpserver] ?
| Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC
On 10/05/11 11:34 AM, Mathieu Bouchard wrote:
On Mon, 9 May 2011, Martin wrote:
It opens the file relative to the folder containing [tcpserver] (it calls fopen with whatever path you give it).
Isn't that only because you start pd from the folder containing [tcpserver] ?
Yes, that seems to be what is happening. The path is the one Pd was started from, so if you start Pd from the folder containing the files to be sent, it will find all the files. If you start Pd by double-clicking on a Pd icon, you'll have to give the full path.
Martin
----- "Martin" martin.peach@sympatico.ca a écrit :
If the data you're sending is a symbol instead of numbers, the symbol will be interpreted as a file name, so [client 1 hello.jpg( will send hello.jpg as raw bytes. The other end will just receive the raw bytes, so it would need to know what to do with it.
How the raw bytes would be writen to the hard drive? I've used once a claudius maximus external for that, which I don't remember the name, it was working good with small files only.
On 09/05/11 02:29 PM, Patrice Colet wrote:
----- "Martin"martin.peach@sympatico.ca a écrit :
If the data you're sending is a symbol instead of numbers, the symbol will be interpreted as a file name, so [client 1 hello.jpg( will send hello.jpg as raw bytes. The other end will just receive the raw bytes, so it would need to know what to do with it.
How the raw bytes would be writen to the hard drive? I've used once a claudius maximus external for that, which I don't remember the name, it was working good with small files only.
You could load them into a [binfile] or [textfile] and save that.
Martin