468,301 Members | 1,524 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,301 developers. It's quick & easy.

Sending file with winsock

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
4 2699
albertw
267 100+
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
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
albertw
267 100+
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
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.

Similar topics

1 post views Thread by Eric Cory | last post: by
1 post views Thread by Nicolas Ghesquiere | last post: by
1 post views Thread by Robert Dufour | last post: by
2 posts views Thread by =?Utf-8?B?R3JlZ0lJ?= | last post: by
reply views Thread by Teichintx | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.