UDP socket
Ik ben een mirc script aan het vertalen naar php...
Kom ik op lijn 169 blijkt dat deze udp connectie nogal moeilijk is in php
MIRCON line 169:
sockudp -k rcon 7130 %rcon.ip %rcon.port ÿÿÿÿrcon %rcon.challengenumber " $+ %rcon.password $+ " logaddress_add %rcon.myip 7130
In de mirc handleiding vinden we onder sockudp:
UDP Sockets
UDP is a connection-less protocol, ie. you can send information via UDP to other UDP addresses without needing to connect to them first.
UDP does not guarantee that any information you send will actually reach it's destination, ie. it isn't a reliable protocol. Also, be aware that UDP packets may not arrive in the same order as that in which they were sent. This means that you must perform your own checking to confirm that any data you sent actually reached it's destination properly.
/sockudp [-bntkd] [bindip] <name> [port] <ipaddress> <port> [numbytes] [text|%var|&binvar]
If you specify the -t switch, it forces mIRC to send anything beginning with a & as normal text instead of interpreting it as a binary variable. The -n switch appends a $crlf to the line being sent if it's not a &binvar and if it doesn't already have a $crlf.
The -b switch indicates that you are specifying the numbytes value which is the number of bytes you want sent.
The -k switch forces the socket to stay open, this allows it to listen for data that is sent to its port via UDP. If -k is not specified, the socket is opened, the information is sent to the specified ipaddress and port, and the socket is then closed.
The -d switch means that you specified an ip address as the bind address.
If you specify a socket name that doesn't exist, it is created. If it does exist, the existing socket is used to send the info.
You can also specify the local port number that you wish to use, if it isn't specified, mIRC chooses one randomly.
ipaddress and port specify the destination address to which you want to send information. You can only use an IP address here.
On error: if a /sockudp fails, it sets $sock().wserr to the error value, and triggers the on sockwrite event with $sockerr set.
on 1:udpread:name:commands The udpread event is triggered when there is info waiting to be read on a UDP socket. You can read this info using the /sockread command.
Note: If this event triggers but no /sockread is performed to attempt to read the buffer, it is assumed that no script exists that is handling this buffer, so it is cleared and the info it contained is lost.
Merk op: er worden 2 poorten gebruikt...
ik heb iets opgevangen over een listening poort instelle ofzo maar snap daar niet echt veel van
Het volledige mirc script (MIRCON) is te downloaden op http://www.mircscripte.de/dl/scripts.php?cid=2&id=34
ik hoop dat iemand er meer verstand van heeft dan ik...
Groetjes,
Ward
Er zijn nog geen reacties op dit bericht.