59 printf(
"testTSocket: Creating TUDPSocket\n");
60 TUDPSocket * fSocket =
new TUDPSocket(
"localhost", 1500);
62 if (!fSocket || !fSocket->IsValid()) {
63 Error(
"testTSocket",
"cannot connect to localhost");
67 TString msg =
"testTSocket: Testing TSocket with UDP";
69 printf(
"%s\n",msg.Data());
71 if (fSocket->SendRaw(msg.Data(), msg.Length()) == -1) {
72 Error(
"testTSocket",
"error sending command to host %s", fServer.GetHost());
76 char msgRaw[1024] = {0};
78 fSocket->SetOption(kNoBlock, 1);
81 Int_t recvBytes = fSocket->RecvRaw(msgRaw, 1024);
84 Error(
"testTSocket",
"error receiving data from host %s", fServer.GetHost());
88 printf(
"Received Message: \n%s\n",msgRaw);