On Monday, April 15, 2002, at 02:31 PM, James Taylor wrote:
> I'm sure this is frequently asked, and I am truly sorry if it is, but > reading through my mail I don't see this question anywhere: > > Curious as to how I would go about creating bidirectional sockets, ie. > client sends information to the server, then server responds to the > client. I need to know how to do this so that I can tell whether or not > an operation was successful or not. The server is currently set up like: > > while ($new_sock = $sock->accept()) { > while (defined ($buf = <$new_sock>)) { > (do something); > } > } > > I tried printing to $new_sock, but the client obviously isn't listening - > Do I have to create a client/server for both the actual client, AND the > server? Can someone point me in the right direction here? Thanks only one side has to be a server, but both sides have do have listen. if client doesn't listen how would it get anything in from the server? so, yes. you might want to set up some protocol so each side can identify a start and end of a message. client doesn't do $sock->accept. That's only difference. both side do: read using: $message = <$new_sock>; write using: print $new_sock, $messsage; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]