OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 virtual ~Socket() {} | 432 virtual ~Socket() {} |
433 | 433 |
434 // Server initialization. | 434 // Server initialization. |
435 virtual bool Bind(const int port) = 0; | 435 virtual bool Bind(const int port) = 0; |
436 virtual bool Listen(int backlog) const = 0; | 436 virtual bool Listen(int backlog) const = 0; |
437 virtual Socket* Accept() const = 0; | 437 virtual Socket* Accept() const = 0; |
438 | 438 |
439 // Client initialization. | 439 // Client initialization. |
440 virtual bool Connect(const char* host, const char* port) = 0; | 440 virtual bool Connect(const char* host, const char* port) = 0; |
441 | 441 |
442 // Close. | 442 // Shutdown socket for both read and write. This causes blocking Send and |
443 virtual bool Close() = 0; | 443 // Receive calls to exit. After Shutdown the Socket object cannot be used for |
| 444 // any communication. |
| 445 virtual bool Shutdown() = 0; |
444 | 446 |
445 // Data Transimission | 447 // Data Transimission |
446 virtual int Send(const char* data, int len) const = 0; | 448 virtual int Send(const char* data, int len) const = 0; |
447 virtual int Receive(char* data, int len) const = 0; | 449 virtual int Receive(char* data, int len) const = 0; |
448 | 450 |
449 virtual bool IsValid() const = 0; | 451 virtual bool IsValid() const = 0; |
450 | 452 |
451 static bool Setup(); | 453 static bool Setup(); |
452 static int LastError(); | 454 static int LastError(); |
453 static uint16_t HToN(uint16_t value); | 455 static uint16_t HToN(uint16_t value); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 bool active_; | 507 bool active_; |
506 PlatformData* data_; // Platform specific data. | 508 PlatformData* data_; // Platform specific data. |
507 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); | 509 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); |
508 }; | 510 }; |
509 | 511 |
510 #endif // ENABLE_LOGGING_AND_PROFILING | 512 #endif // ENABLE_LOGGING_AND_PROFILING |
511 | 513 |
512 } } // namespace v8::internal | 514 } } // namespace v8::internal |
513 | 515 |
514 #endif // V8_PLATFORM_H_ | 516 #endif // V8_PLATFORM_H_ |
OLD | NEW |