Einzelnen Beitrag anzeigen

Benutzerbild von sirius
sirius

Registriert seit: 3. Jan 2007
Ort: Dresden
3.443 Beiträge
 
Delphi 7 Enterprise
 
#6

Re: Udpsocket onReceive Ereignis wird nicht ausgelöst?

  Alt 7. Jul 2008, 16:05
Du kannst ja mal das onError-Event nutzen und dann den String SyserrorMEssage(SocketError) ausgeben.
Bei mir sagt er, dass es keiner VErbindung zum Remotehost gibt, was für ein UDP-Socket ja völliger Blödsinn ist.

Eigenartigerweise macht die Komponente ein Connect mit einem UDP Socket. Laut WinSDK ist das auch soweit ok, aber ein recv geht mit so einem Socket anscheinend nicht.

Was auch immer das uns sagen will:
Zitat von winSDK:
For a connectionless socket (for example, type SOCK_DGRAM), the operation performed by connect is merely to establish a default destination address which will be used on subsequent send/WSASend and recv/WSARecv calls. Any datagrams received from an address other than the destination address specified will be discarded. If the address field of the name structure is all zeroes, the socket will be "dis-connected." Then, the default remote address will be indeterminate, so send/WSASend and recv/WSARecv calls will return the error code WSAENOTCONN. However, sendto/WSASendTo and recvfrom/WSARecvFrom can still be used. The default destination can be changed by simply calling connect again, even if the socket is already "connected". Any datagrams queued for receipt are discarded if name is different from the previous connect.

Ich schaue nachher nochmal genauer rein.
Dieser Beitrag ist für Jugendliche unter 18 Jahren nicht geeignet.
  Mit Zitat antworten Zitat