IOhannes m zmölnig wrote:
Martin Peach wrote:
Umm, isn't the local port always 80 for http, and the remote and local
no, who told you that? on most operating system you will need special privileges to open a local port below 1024.
port numbers always identical for tcp?
no, who told you that? only the remote (server) port is fixed. the client usually chooses any free port (in the high range).
Of course you're right. I was looking at the source code for [tcpclient] (which is mostly the same as [netclient]) and the only port specified is the remote one, which I misunderstood late at night as meaning they were the same. There is no way if knowing what the local port is, it seems, because it's not important, nobody else can connect to it anyhow, under tcp a two-way connection is made, unlike udp. So why does padawan need to know it? Maybe he should be using [tcpserver] instead, or udp?
Anyway, [tcpclient] lets you do the important CRLF combo which [netclient] won't, and any http-compliant web server will not reply until it gets that.
you can add CRLF with [netclient] as well, but it is far more complicated than with [tcpclient]. on the other side, it is more complicated to generate your query and interpret the response with [tcpclient]
The main motivation for me in implementing strings was so I could do a pd-based web server using [tcpserver] without having to use ASCII codes. Haven't had time to even start it yet :(
Martin
mfga.sdr IOhannes
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list