mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-12 12:57:13 +02:00
SlsDetector client library and servers. First import.
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@1 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
40
slsDetectorSoftware/MySocketTCP/send.cxx
Normal file
40
slsDetectorSoftware/MySocketTCP/send.cxx
Normal file
@ -0,0 +1,40 @@
|
||||
|
||||
//version 1.0, base development ij 19/01/09
|
||||
|
||||
#include <iostream>
|
||||
#include "MySocketTCP.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main(int argc, char *argv[]){
|
||||
|
||||
if(argc!=2){
|
||||
cout<<"Usage: send ip_addess/hostName"<<endl;
|
||||
return 1;
|
||||
}
|
||||
cout<<"rec function must be first called."<<endl;
|
||||
|
||||
char ip_address[200];
|
||||
sprintf(ip_address,"%s",argv[1]);
|
||||
unsigned short int portnum = 1952;
|
||||
|
||||
|
||||
char data[50000];
|
||||
int length=50000;
|
||||
|
||||
MySocketTCP* sock = new MySocketTCP(ip_address,portnum);
|
||||
|
||||
cout<<"\tSending :"<<sock->SendDataAndKeepConnection(data,2000)<<endl;
|
||||
cout<<"\tSending :"<<sock->SendData(data,2200)<<endl;
|
||||
cout<<"\tSending :"<<sock->SendData(data,1200)<<endl;
|
||||
|
||||
|
||||
cout<<"\tSending :"<<sock->SendData(data,25000)<<endl;
|
||||
|
||||
cout<<"\tSending :"<<sock->SendData(data,222)<<endl;
|
||||
|
||||
delete sock;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user