Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

How to change local-port?

 [1/4] from: semseddinm::bircom::com at: 13-Jan-2009 11:31


Hi, I'm trying to open a UDP port with a specified local-port, but local-port is changed when I send something. Here is what I done (in console) p: open [ scheme: 'udp host: 127.0.0.1 port-id: 9000 local-port: 9090 ] ? p P is a port of value: make port! [ scheme: 'udp host: 127.0.0.1 port-id: 9000 local-ip: 156.135.68.0 remote-ip: 127.0.0.1 local-port: 5377 ;<--- it takes this automatically remote-port: 9000 ... ] Then I change it again: p/local-port: 9090 ? p P is a port of value: make port! [ scheme: 'udp host: 127.0.0.1 port-id: 9000 local-ip: 156.135.68.0 remote-ip: 127.0.0.1 local-port: 9090 ;<--- it looks ok remote-port: 9000 ... ] Then send something.. insert p "testing" then it takes another local-port automatically.. ? p P is a port of value: make port! [ scheme: 'udp host: 127.0.0.1 port-id: 9000 local-ip: 156.135.68.0 remote-ip: 127.0.0.1 local-port: 2282 ;<--- it changed again? remote-port: 9000 ... ] Is it not possible to change local-port? Or prevent to change it automatically. I think it should be. Sorry for the long email.

 [2/4] from: bga-bug at: 13-Jan-2009 8:29


=DEemseddin Moldibi [ Bircom ] wrote:
> I'm trying to open a UDP port with a specified local-port, but > local-port is changed when I send something.
This is how TCP/IP works. the origin port is picked up by the OS itself. -Bruno

 [3/4] from: semseddinm::bircom::com at: 13-Jan-2009 12:37


Thank you, I know that OS allocates a port for you, but only if you set local port to 0 (zero), if you set local port value other than 0 than OS will try to allocate that port. And you should be able to change the local port to prevent firewall problems. Many applications use specific local ports. It is also possible some other languages like VB (you can set local port before accept the connection) and I don't think this is a language feature.

 [4/4] from: santilli::gabriele::gmail::com at: 13-Jan-2009 17:40


T24gVHVlLCBKYW4gMTMsIDIwMDkgYXQgMTA6MzEgQU0sIMWeZW1zZWRkaW4gTW9sZGliaSBbIEJp cmNvbSBdCjxzZW1zZWRkaW5tQGJpcmNvbS5jb20+IHdyb3RlOgoKPiBIaSwKPiBJJ20gdHJ5aW5n IHRvIG9wZW4gYSBVRFAgcG9ydCB3aXRoIGEgc3BlY2lmaWVkIGxvY2FsLXBvcnQsIGJ1dCA9Cj4g bG9jYWwtcG9ydCBpcyBjaGFuZ2VkIHdoZW4gSSBzZW5kIHNvbWV0aGluZy4KCkl0J3MgYSBiaXQg Y291bnRlci1pbnR1aXRpdmUgKFVEUCBpcyBzb3J0LW9mIGhhbGYgaW1wbGVtZW50ZWQgaW4KUjIp Li4uIGJ1dCBpdCB3b3JrcyB0aGlzIHdheToKCiAgICA7IGJpbmQgdG8gYSBzcGVjaWZpYyBwb3J0 CiAgICBwOiBvcGVuIHVkcDovLzo5MDkwCiAgICA7IHNldCByZW1vdGUtaXAgYW5kIHJlbW90ZS1w b3J0CiAgICA7IG9yIHRoZXkgYXJlIHNldCBhdXRvbWF0aWNhbGx5IHdoZW5ldmVyIHlvdSByZWNl aXZlIGEgcGFja2V0ICh3aXRoIENPUFkpCiAgICBwL3JlbW90ZS1pcDogMTI3LjAuMC4xCiAgICBw L3JlbW90ZS1wb3J0OiA5MDAwCiAgICA7IHNlbmQgYSBwYWNrZXQKICAgIGluc2VydCBwICJzb21l IGRhdGEiCgpIVEgsCiAgICBHYWJyaWVsZQo=