[Implemented] Source Port at UDP Network

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Joshua314
New User
New User
Posts: 7
Joined: Sat Aug 20, 2005 12:32 pm

[Implemented] Source Port at UDP Network

Post by Joshua314 »

Hi @ All,

at OpenNetworkConnection(ServerName$, Port,#PB_Network_UDP) you can select the destination Port.

But Purebasic use a random Port to send the UPD packet. It is possible to select source & destination port on a new Version ???

best Thomas
jesperbrannmark
Enthusiast
Enthusiast
Posts: 536
Joined: Mon Feb 16, 2009 10:42 am
Location: sweden
Contact:

Re: Source Port at UDP Network

Post by jesperbrannmark »

What do you mean? If the port is random - how do we know what to receive and if someone is sending something? It couldnt be random, then no communication could occur? Right?
DarkDragon
Addict
Addict
Posts: 2344
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Re: Source Port at UDP Network

Post by DarkDragon »

Sure it is decided randomly by the operating system if no bind_() was called.

Here is a workaround:
http://www.purebasic.fr/german/viewtopi ... 91#p257091

You've got a source port and a destination port!
bye,
Daniel
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: Source Port at UDP Network

Post by blueznl »

As for a work around, do a little search for 'winsock' on the forums.
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Joshua314
New User
New User
Posts: 7
Joined: Sat Aug 20, 2005 12:32 pm

Re: Source Port at UDP Network

Post by Joshua314 »

Hello @ All

The problem is that
For Amateur Radio Packet Radio Flexnet-System works on udp

For comunication you need a fix source port on udp
for windows the work around is ok ..... but i need this word around for linux .....


so the best way is that. to implement this direct in Pure.....

best Thomas
DarkDragon
Addict
Addict
Posts: 2344
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Re: Source Port at UDP Network

Post by DarkDragon »

The workaround also will work on linux, as Sockets on Windows and Linux are mostly equal.
bye,
Daniel
Post Reply