1

I am using Unix domain sockets to do some interprocess communication in Linux. Upon connection, the client sends a struct using send to the server. This struct contains some information about the client including an identifier string at the end. The server receives the info just find and sends another struct back. The client blocks with recv, but never gets anything. The server completes the send call without any errors and moves on.

Is there something fundamental that I am missing here? When I send strings across the socket both sides send and receive just fine. Does the data have to have a terminating NULL? That does not seem right...

waffleman
  • 4,159
  • 10
  • 39
  • 63
  • Are the sockets in datagram or stream mode? – Ben Voigt Sep 13 '10 at 22:20
  • They are in stream mode. – waffleman Sep 13 '10 at 22:25
  • Your question implies that this only happens with structs. Does everything work fine with ints or chars? – Mike DeSimone Sep 13 '10 at 22:32
  • This sounds like the kind of thing that would be explained in a man page for one of the relevant function calls. Not that it's a bad question for SO, I just would advise you to have a careful look at the documentation while you're waiting for answers. – David Z Sep 13 '10 at 22:49
  • What you've described should work fine. Perhaps try and isolate the problem to a small code sample? – caf Sep 14 '10 at 00:09
  • @ David: The man pages are the first place that I checked and I didn't find anything relevant. – waffleman Sep 14 '10 at 12:29

2 Answers2

1

When I came in the next day, I could not reproduce the error again.

waffleman
  • 4,159
  • 10
  • 39
  • 63
0

Try flushing the socket on the server.

Steve Emmerson
  • 7,702
  • 5
  • 33
  • 59