|
Last change
on this file since 7626 was 1054, checked in by casaldaliga, 24 years ago |
|
changed .H to .hxx in includes to work with new naming
|
|
File size:
1.1 KB
|
| Line | |
|---|
| 1 | #ifndef TCPSENDER
|
|---|
| 2 | #define TCPSENDER
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 | #include "PeriodicAction.hxx"
|
|---|
| 6 | #include "socket_functions.h"
|
|---|
| 7 | #include <string>
|
|---|
| 8 | //in Makefile#define MAXMSG 4096
|
|---|
| 9 |
|
|---|
| 10 | class TCPSender : public Object{
|
|---|
| 11 | public:
|
|---|
| 12 | char servName[100];
|
|---|
| 13 | unsigned short int servPort;
|
|---|
| 14 |
|
|---|
| 15 | TCPSender (char * servName_, unsigned int servPort_ );
|
|---|
| 16 | ~TCPSender();
|
|---|
| 17 |
|
|---|
| 18 | void CloseConnection();
|
|---|
| 19 | int IODescriptor();
|
|---|
| 20 | bool isTrialToConnectSuccesful();
|
|---|
| 21 | void Send (char *msg );
|
|---|
| 22 | void Reset();
|
|---|
| 23 |
|
|---|
| 24 | void Receive ();
|
|---|
| 25 | //Syncronous receive. If you are not sure there will be data to read, schedule this receive with IONotifier or something. Otherwise it will block
|
|---|
| 26 | string ReturnNew ();
|
|---|
| 27 | private:
|
|---|
| 28 | struct sockaddr_in server;
|
|---|
| 29 |
|
|---|
| 30 | //file descriptor
|
|---|
| 31 | int socketItself;
|
|---|
| 32 |
|
|---|
| 33 | bool comMode;//better called isCommUp
|
|---|
| 34 | unsigned long int retryingTime;//in usec
|
|---|
| 35 | bool newReceived;
|
|---|
| 36 | char receivedStream[MAXMSG];
|
|---|
| 37 |
|
|---|
| 38 | PeriodicAction tryingConnect;
|
|---|
| 39 |
|
|---|
| 40 | //this->CloseConnection method should be capitalized for some consistency. Put the change should be propagated. class Make up!
|
|---|
| 41 | virtual void process ();
|
|---|
| 42 | };
|
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 |
|
|---|
| 46 |
|
|---|
| 47 | #endif
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.