Предыдущая тема :: Следующая тема |
Автор |
Сообщение |
poseti Клиент ПО Хостинг
Зарегистрирован: 29.03.2004 Сообщения: 237 Откуда: Сатурн
|
Добавлено: Пн Авг 09, 2004 5:40 pm);00ПонедельникUTCUTCp(111);// Заголовок сообщения: Сокеты в С++ (Linux OS) |
|
|
Нужна помощь программеров С++(Linux OS)
Необходимо открыть сокет на 80-й порт TCP
Переконопатил тучу файлов в /usr/include
Нашел socket.h не в одном экземпляре и столкнулся с такой проблемкой...
Вот часть кода:
/* Create a new socket of type TYPE in domain DOMAIN, using
protocol PROTOCOL. If PROTOCOL is zero, one is chosen automatically.
Returns a file descriptor for the new socket, or -1 for errors. */
extern int socket (int __domain, int __type, int __protocol) __THROW;
Но меня шокирует тип __domain ... вроде как я знаю имя хоста или домена куда я собираюсь устраивать конект должно быть *char или в крайнем случае string... так как тут быть?
Может у кого есть опыт работы с сокетами в Linux-е или кто-то качал html файлы из-под С++ ?? _________________ .... |
|
Вернуться к началу |
|
|
admin Администратор сайта
Зарегистрирован: 15.11.2003 Сообщения: 840 Откуда: ПО Хостинг, Израиль
|
Добавлено: Пн Авг 09, 2004 8:20 pm);16ПонедельникUTCUTCp(111);// Заголовок сообщения: |
|
|
Может это айпи в хексе, Ваш сейчас ХХefc49c
Чисто догадка, не более |
|
Вернуться к началу |
|
|
poseti Клиент ПО Хостинг
Зарегистрирован: 29.03.2004 Сообщения: 237 Откуда: Сатурн
|
Добавлено: Пт Авг 13, 2004 8:53 pm);50ПятницаUTCUTCp(111);// Заголовок сообщения: |
|
|
Нет.... вроде не то....
Придется искать дальше. _________________ .... |
|
Вернуться к началу |
|
|
admin Администратор сайта
Зарегистрирован: 15.11.2003 Сообщения: 840 Откуда: ПО Хостинг, Израиль
|
Добавлено: Ср Авг 18, 2004 11:26 am);24СредаUTCUTCp(111);// Заголовок сообщения: |
|
|
Один из наших клиентов помог:
It is incorrect parameter name. Should be:
http://www.mez.ruhr-uni-bochum.de/online.documents/libc/libc_203.html
Creating a Socket
The primitive for creating a socket is the socket function, declared in `sys/socket.h'.
Function: int socket (int namespace, int style, int protocol)
This function creates a socket and specifies communication style style, which should be one of the socket styles listed in section Communication Styles. The namespace argument specifies the namespace; it must be PF_FILE (see section The File Namespace) or PF_INET (see section The Internet Namespace). protocol designates the specific protocol (see section Socket Concepts); zero is usually right for protocol.
The return value from socket is the file descriptor for the new socket, or -1 in case of error. The following errno error conditions are defined for this function:
EPROTONOSUPPORT
The protocol or style is not supported by the namespace specified.
EMFILE
The process already has too many file descriptors open.
ENFILE
The system already has too many file descriptors open.
EACCESS
The process does not have privilege to create a socket of the specified style or protocol.
ENOBUFS
The system ran out of internal buffer space.
The file descriptor returned by the socket function supports both read and write operations. But, like pipes, sockets do not support file positioning operations.
I've already seen a couple of times incorrect documentation on Linux. Open Source...
The destination host and port are specified in connect() function.
Ask me if you have further questions, I'll try to help.
Best Regards,
Andrew |
|
Вернуться к началу |
|
|
poseti Клиент ПО Хостинг
Зарегистрирован: 29.03.2004 Сообщения: 237 Откуда: Сатурн
|
Добавлено: Ср Авг 18, 2004 7:59 pm);29СредаUTCUTCp(111);// Заголовок сообщения: |
|
|
Thanks for help _________________ .... |
|
Вернуться к началу |
|
|
cdef347
Зарегистрирован: 20.10.2008 Сообщения: 131
|
Добавлено: Пн Окт 20, 2008 8:15 pm);42ПонедельникUTCUTCp(111);// Заголовок сообщения: wow gold!!good!!!! |
|
|
Your soft, I have great inspiration! ! ! Welcome to wow gold, here is the wow Zone! ! ?FFXI GIL good! ! _________________ wow gold |
|
Вернуться к началу |
|
|
|