PDA

Click to See Complete Forum and Search --> : address in use?


psychotomus
Aug 5th, 2007, 01:40 PM
says address in use? Don't really understand.

frmFileTransfers.Winsock1(frmFileTransfers.Winsock1.Count - 1).Connect IPAddress, 9106

EDIT: attached the project.
error acurses in frmFileAcceptDialoge in the Accept button.

psychotomus
Aug 5th, 2007, 01:53 PM
forgot project

XCustoms
Aug 7th, 2007, 07:28 PM
Try another port

psychotomus
Aug 10th, 2007, 05:57 PM
changing the port doesn't work.

dilettante
Aug 15th, 2007, 09:27 AM
Wild guess:

This Winsock control is being reused a second time, and ultimately a third time, etc. Its LocalPort property is not being reset to zero (0) before re-using it, i.e. Connect being called again.

A Winsock "address" consists of the protocol (TCP vs. UDP), local port number, and local IP address taken together in this context. Using a LocalPort of 0 tells Winsock to allocate a free ephemeral port and assign it for you. It's a bit like using FreeFile() to allocate a file number for VB native I/O operations.

psychotomus
Aug 15th, 2007, 06:35 PM
so change localport to 0 then set it to whatever i want to set it to?

dilettante
Aug 16th, 2007, 09:46 AM
Set LocalPort to 0 before doing each Connect.