DHCP Server ?
DHCP Server ?
Do you think that it's possible to code a DHCP server in PureBasic ?
- Michael Vogel
- Addict

- Posts: 2820
- Joined: Thu Feb 09, 2006 11:27 pm
- Contact:
Re: DHCP Server ?
Think so, but I think it will not be easy to do that platform independent - so in what OS should it run?Progi1984 wrote:Do you think that it's possible to code a DHCP server in PureBasic ?
All I did is to send and receive ICMP packets to do a network scan with windows - this can be done by API calls, but as I know, "self defined packets" can't be done (easily) with standard winsock. Maybe someone else has already read the available documentation of winsock?!
- Michael Vogel
- Addict

- Posts: 2820
- Joined: Thu Feb 09, 2006 11:27 pm
- Contact:
No, just have a look into the Network Commands of PureBasic - more than in other languages, but still only for simple things (get own ip addresses, etc.) and special commands for doing a client server relation between two PureBasic programs (network games, etc.).Progi1984 wrote:Is it not possible to do that with purebasic commands ?
If doing advanced things, it can still be a possibility which is not too complicate, if you know how to do the API calls or the call for a certain DLL. For instance, the following lines are still PureBasic commands, if you want - but they call the windows API for doing a "ping"...
Code: Select all
ResultSize = SizeOf(ICMP_ECHO_REPLY)+Len(Packet); anstelle von Len(Message)
*Result = AllocateMemory(ResultSize)
*Echo.ICMP_ECHO_REPLY = *Result
If IpAddress <> 0
hFile = IcmpCreateFile_()
If IcmpSendEcho_(hFile, IpAddress, Packet, Len(Packet), 0, *Result, ResultSize, Timeout) > 0
Ergebnis=*Echo\RoundTripTime
Else
Ergebnis=-1
EndIf
IcmpCloseHandle_(hFile)
Else
Ergebnis=-2
EndIf
FreeMemory(*Result)I don't consider ICMP packtes something which is really needed for normal software, but you are right there are problems in the network lib nevertheless, we even have examples that show that you can write an ICQ Client in Purebasic which indeed is advanced. A DHCP Server though needs API since it needs IMHO commands which are very raely usefull in normal applications even in Network ones.
Visit www.sceneproject.org