Re: binary data with winsock.ew
- Posted by Alan Tu <alantu at STUDENTS.UIUC.EDU> Mar 24, 2000
- 412 views
Thanks for the info, Bryan. I always get a little mystified about the handling "mangling" of those CRLF. If I desired an FTP server, I think I can get one. My fantasy program is a custom server where only I could access it. I have a computer which I leave on all the time, and when I'm at another location, it'd be cool to access my files. But if I publicly expose my standard FTP port, I could be opening up my system to all sorts of things. My program would listen for connections on a high port only I would know. There'd be a secret 128-bit file that I'd have to send to my server once I connect. All file transfers will be encrypted with another previously set up key. At least, this is my fantasy program. Although, I will say I have many pieces of the puzzle already written. Alan ----- Original Message ----- From: "Brian Jackson" <bjackson at 2FARGON.COM> To: <EUPHORIA at LISTSERV.MUOHIO.EDU> Sent: Friday, March 24, 2000 10:00 AM Subject: Re: binary data with winsock.ew > On Fri, 24 Mar 2000 10:14:27 -0600, Alan Tu <alantu at STUDENTS.UIUC.EDU> > wrote: > > >I have a question about the current implementation of winsock. I want to > >create a custom server and client (written in EU, of course) that will > >transfer files from the server to the client. Is the ReadData and Senddate > >libraries in winsock.ew restricted to ASCII "low bits" bytes, or can it > read > >and send all 255 bytes. Thanks. > > > >Alan > > Winsock functions treat all data as binary, so you can read/write all 256 > bits. For example, if you wanted to send a small .exe program using your > server, you would open it in rb mode, and send it to the client using the > sendData() function. The client would use readData(), and write it to a > file in wb mode. For purely text documents, like txt and html files, you'd > want to read and write in ASCII mode because CRLF's get mangled going from > Unix to DOS/Win and vice versa. > > Also, if you're just wanting to transfer files, you should check out > WinInet, since it makes extensive use of the FTP protocols, and then your > server would be accesible by all FTP clients. > > Brian >