By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,057 Members | 1,346 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,057 IT Pros & Developers. It's quick & easy.

Sending file with winsock

P: 8
Hi, I am making a LAN messaging program and I want to add file transfer. I know how to send text with winsock. But I was just wondering how do you actually open the file you want and send it. And how does the client go about receiving the file????

Thanks.
Nov 15 '06 #1
Share this Question
Share on Google+
4 Replies


100+
P: 267
Hi, I am making a LAN messaging program and I want to add file transfer. I know how to send text with winsock. But I was just wondering how do you actually open the file you want and send it. And how does the client go about receiving the file????

Thanks.
hi

use a protocol (UDP is easiest)
and something like...


With udpIN
.RemoteHost = vbNullString ' set SERVER to listen
.RemotePort = 1003 'Port to connect to.
.Bind 1004 'Bind to the local port.
End With

With udpOUT
.RemoteHost = remotecomputername ' CLIENT - talk
.RemotePort = 1004 ' Port to connect to.
.Bind 1003 ' Bind to the local port.
End With

udpOUT.SendData filename


(not tested this yet, know with text it works)
Nov 15 '06 #2

P: 8
hi

use a protocol (UDP is easiest)
and something like...


With udpIN
.RemoteHost = vbNullString ' set SERVER to listen
.RemotePort = 1003 'Port to connect to.
.Bind 1004 'Bind to the local port.
End With

With udpOUT
.RemoteHost = remotecomputername ' CLIENT - talk
.RemotePort = 1004 ' Port to connect to.
.Bind 1003 ' Bind to the local port.
End With

udpOUT.SendData filename


(not tested this yet, know with text it works)
Hi, I thought you had to add some stuff about changing it to binary?
Nov 15 '06 #3

100+
P: 267
Hi, I thought you had to add some stuff about changing it to binary?
hi

suppose your need to use TCP instead
Nov 15 '06 #4

P: 8
hi

suppose your need to use TCP instead
Yeah because the packets arrive in the correct order
Nov 15 '06 #5

Post your reply

Sign in to post your reply or Sign up for a free account.