A semiconductor laser system with delayed optoelectronic feedback has very interesting nonlinear phenomena and important applications in optical communications. By controlling the operating conditions like bias current, feedback strength, and feedback delay time, the system is found to generate different states such as periodic pulsing, quasiperiodic pulsing and chaotic pulsing. With the system operating in periodic pulsing, a stable repetitive pulse stream is generated. The pulsing frequency can be tuned from hundreds of megahertz to a few gigahertz by simply adjusting the operating conditions. Therefore, we can make a new device which generates short optical pulses with a tunable pulsing frequency. Making use of the chaotic pulsing state, the system can be implemented in chaotic optical communications. Chaotic optical communications are of great current interests because of the advantages in improved communication security and bandwidth efficiency. In our chaotic communication experiment, the chaotic pulsing from a transmitter laser is used to encode messages, while at the receiver an identical semiconductor laser is used to reproduce the chaotic pulsing carrier for decoding. High quality of chaos synchronization between the transmitter and the receiver lasers is achieved in our experiment. Successful encoding and decoding of 2.5~Gbit/s NRZ signal is demonstrated.