
February 18th, 2006, 11:27 PM
|
|
Contributing User
|
|
Join Date: Jan 2006
Posts: 52
Time spent in forums: 10 h 49 m 33 sec
Reputation Power: 3
|
|
Quote: | Originally Posted by Protocol2511
Code:
...
CNXsocket.Socket.RemoteAddress:= (strtoint(ipme));//this line errors
CNXsocket.Socket.RemotePort := (strtoint(portme)); //this line errors
...
i have tried to get items from my listview and connect to them but i get can not assign to read only properity i have tried coding it in different ways but i can not find a solution to this problem thanks in advanced |
what class/component is CNXsocket?
My guess is that you are trying to use a TServerSocket when you should be using a TClientSocket.
with a TServerSocket, you cannot (of course) assign the RemoteAddress and RemotePort. Those things are decided by the incomming client alone (ex: a webserver may run on port 80, but the client software (usually a browser) is free to use any port it wishes on it's own end... The client will also determine its own IP address. The ServerSocket has no control over this.
The RemoteAddress and RemotePort read-only properties simply tell the server details about the incomming clients connection.
In order to specify which ports to connect to, you can use the TServerSocket.Port and TClientSocket.Port properties.
regards,
-Michael
|