Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

localport, remoteport, remotehost etc..problem

Status
Not open for further replies.

kickflip12345

Programmer
Jan 18, 2001
1
PH
i have a problem which is solving error with winsock. im a new to winsock. my problem is this:


---------------------------------------------
With wsk
.Protocol = sckTCPProtocol
.RemoteHost = "198.12.0.1"
.RemotePort = 12345
.LocalPort = 11111

End With
----------------------------------------------

without the localport put in the code, the code runs smoothly. but when i put it there, it has an error like "address in use".
is it wrongly done? this code is put into the clientside of the socket. what im trying to do here is to try to connect to the server with its ".remotehost" and ".remoteport" and the ".localport" is to tell the computer to initialize so that the server will know where to send the data.

pls help!!! does anybody have anymore ideas or encountered this prob? my idea is this: i need the server to know where to send the data and what i thought is to make a localport to the client so it will be unique.

or maybe, can i use the senddata with multiple datas?
like

wsk.senddata (data) <----where data contains many separate datas? like 1 and &quot;adata&quot;

pls help.
 
Hi there,

You only need to specify localport when you're writing a server -- a program that will sit there and listen for a connection request.

If you have a program listening on 12345 on &quot;198.12.0.1&quot; you can call .Connect, instead of setting .LocalPort, and start exchanging data with the server.
Mike
michael.j.lacey@ntlworld.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top