It's not really clear what you're asking. Could you provide a complete and minimal code example, or at least describe the problem in terms of specific SFML functions rather than vague phrases like "set the socket" and "send a message"?
A handful of things you might have been trying to ask (which are covered in the tutorial):
- Can I check whether a connect()/listen()/accept()/etc call was successful? Yes, they all return a status you can and should check.
- Can I check whether the code on a different machine successfully called those functions? No, because it's a different program, running on a different machine. All you can ever do is try to send a message to it and hope you eventually receive some kind of response.
- My program crashes when those functions fail; how do I stop that? Those functions should never *crash* as far as I know; this would indicate something is very wrong with your computer or your program.
- My program hangs when those functions fail; how do I stop that? Use non-blocking sockets or the optional timeout parameter.