[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] UDP sockets i linux



Anders Gnistrup skrev:


Jeg har to processer, der skal udveksle data, men med mindre jeg kalder bind(), kan jeg ikke få recvfrom() til at fungere. Så snart den ene proces har kaldt bind, kan den anden ikke.

Det er ikke muligt at kalde bind() med de samme socket date to gange. Socket file descriptoren er jo blevet låst til den første process.
Det du kan gøre er at den første proces er server (kalder bind) og den anden blot er client. clienten har ikke behov for at kalde bind. Den skal sådan set blot vide hvor den skal sende tingene hen og modtage fra.

Din løsning skal baseres på hvilket problem du ønsker at løse. Er der et master/slave forhold mellem de to processor? skal de begge fungere som master?

Hilsen Anders

Jeg havde fundet ud af bind() kun kan kaldes på en fil én gang.
Det lader bare til, at min klient ikke vil modtage (med recvfrom()) på den samme socket.
Jeg opretter en server, der kalder bind(), og skal derefter modtage en streng, og sende en anden retur. Når den forsøger at sende(sendto()) til klienten, får jeg en "Transport endpoint is not connected".
Jeg har prøvet at kalde connect() fra klienten, men uden det hjælper.




 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-10-01, 02:01 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *