]>
Dogcows Code - chaz/yoink/blob - Service.cc
da135c1fea51513a2f7a4f3af2ebf8c02ab46293
2 /*] Copyright (c) 2009-2010, Charles McGarvey [**************************
3 **] All rights reserved.
7 * Distributable under the terms and conditions of the 2-clause BSD license;
8 * see the file COPYING for a complete text of the license.
10 **************************************************************************/
16 #define SOLICIT 0x1234ABCD
17 #define RESPONSE 0xABCD1234
23 int Service::handlePacket(SocketMultiplexer
& mux
,
25 const SocketAddress
& address
)
38 packet
<< RESPONSE
<< mType
<< mName
<< mText
;
39 mux
.socket().write(packet
);
48 int ServiceFinder::handlePacket(SocketMultiplexer
& mux
,
50 const SocketAddress
& address
)
56 if (magic
== RESPONSE
)
64 packet
>> name
>> text
;
65 Service
service(address
, type
, name
, text
);
66 mServices
.insert(std::make_pair(name
, service
));
75 ServiceFinder::ServiceFinder(const std::string
& type
, int sockType
)
This page took 0.036292 seconds and 3 git commands to generate.