I don't know if it's currently possible to allow setting a source port for ENetHost
After looking through the source code, in unix.c and win32.c there are two functions enet_socket_bind which check if(address!=NULL) assign port/address which is for the server portion but in case address==NULL the function automatically assigns port to 0.
I could write a pull request to allow clients set their source port if it's already not a feature. But I would like to be able to do this.
Edit: I realised I can assign the port by passing a non NULL ENetAddress struct.
I don't know if it's currently possible to allow setting a source port for
ENetHost
After looking through the source code, in unix.c and win32.c there are two functionsenet_socket_bind
which checkif(address!=NULL)
assign port/address which is for the server portion but in caseaddress==NULL
the function automatically assigns port to 0.I could write a pull request to allow clients set their source port if it's already not a feature. But I would like to be able to do this.
Edit: I realised I can assign the port by passing a non NULL ENetAddress struct.