[灌水]第一眼就感觉这是针对我的呀。表达一下看法吧
发表于:2018-03-06 10:51只看该作者
2楼
发表于:2018-03-06 11:45只看该作者
3楼
本帖最后由 zsmtk 于 2018-3-6 19:55 编辑
万元户酸千元户, 千元户怼百刀党,
百元党笑模拟盘。
其实讽与被讽者都一个德性,别叫屈莫喊冤!
哈哈哈哈
点评
发表于 2018-03-07 11:19
发表于:2018-03-06 16:53只看该作者
5楼
zsmtk 发表于 2018-3-6 19:45
万元户酸千元户, 千元户怼百刀党, 百元党笑模拟盘。 其实讽与被讽者都一个德性,别叫屈莫喊冤!
韬客社区www.talkfx.co
发表于:2018-03-06 23:48只看该作者
6楼
几百美金算是正确的路吧。
先几百能盈利了,然后用C写个socket通信的DLL,写个MT4跟单程序。这程序我写过两三晚上搞定
再开一两个1000美金的账户,一拖一或者一拖几跟单。慢慢做大。
韬客社区www.talkfx.co
发表于:2018-03-07 00:15只看该作者
7楼
下面的源码就是通信DLL。很久之前写的,刚才找到的。感兴趣的话可以自己去写
/*
* myDLLs.c
*
* Created on: Jan 27, 2016
* Author: Andy
*/
#include "commDLLs.h"
#include "winsock2.h"
#include "stdlib.h"
#define BUFFER_SIZE 1024
//returning host listening socket ID
unsigned int createHostSocket(void)
{
WSADATA wsaData;
SOCKET ListeningSocket;
//SOCKET NewConnection;
SOCKADDR_IN ServerAddr;
//SOCKADDR_IN ClientAddr;
int Port = 10002;
//int ClientAddrLen;
//unsigned long mode = 1;
//int maxRetry = 5;
int ret = 0;
WSAStartup(MAKEWORD(2,2), &wsaData);
// Create a new socket to listen for client connections.
ListeningSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if(ListeningSocket == -1) return 0;
// Set up a SOCKADDR_IN structure that will tell bind that we
// want to listen for connections on all interfaces using port
// 10002 Notice how we convert the Port variable from host byte
// order to network byte order.
ServerAddr.sin_family = AF_INET;
ServerAddr.sin_port = htons(Port);
ServerAddr.sin_addr.s_addr = htonl(INADDR_ANY);
// Associate the address information with the socket using bind.
ret = bind(ListeningSocket, (SOCKADDR *)&ServerAddr, sizeof(ServerAddr));
if(ret == -1)
{
closesocket(ListeningSocket);
return 0;
}
// Listen for client connections. We used a backlog of 5, which
// is normal for many applications.
ret = listen(ListeningSocket, 5);
if(ret == -1)
{
closesocket(ListeningSocket);
return 0;
}
//ioctlsocket(ListeningSocket, FIONBIO, &mode);
SOCKADDR_IN ClientAddr;
int ClientAddrLen;
ClientAddrLen = sizeof(struct sockaddr_in);
SOCKET NewConnection = 0;
NewConnection = accept(ListeningSocket, (SOCKADDR *)&ClientAddr,&ClientAddrLen);
if(NewConnection == -1)
{
closesocket(ListeningSocket);
WSACleanup();
return 0;
}
else
{
//ioctlsocket(NewConnection, FIONBIO, &mode);
closesocket(ListeningSocket);
return NewConnection;
}
return ListeningSocket;
}
//returning client socket ID
unsigned int createClientSocket(void)
{
WSADATA wsaData;
SOCKET s = INVALID_SOCKET;
SOCKADDR_IN ServerAddr;
int Port = 10002;
int iResult = 0;
unsigned long mode = 1;
// Initialize Winsock version 2.2
WSAStartup(MAKEWORD(2,2), &wsaData);
// Create a new socket to make a client connection.
s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if(s == -1)
{
WSACleanup();
return 0;
}
// Set up a SOCKADDR_IN structure that will be used to connect
// to a listening server on port 5150. For demonstration
// purposes, let's assume our server's IP address is 136.149.3.29.
// Obviously, you will want to prompt the user for an IP address
// and fill in this field with the user's data.
ServerAddr.sin_family = AF_INET;
ServerAddr.sin_port = htons(Port);
//ServerAddr.sin_addr.s_addr = inet_addr("192.168.0.100"); //LAN
ServerAddr.sin_addr.s_addr = inet_addr("127.0.0.1"); //ocal
// Make a connection to the server with socket s.
iResult = connect(s, (SOCKADDR *) &ServerAddr, sizeof(ServerAddr));
if(iResult == -1)
{
closesocket(s);
WSACleanup();
return 0;
}
else
{
ioctlsocket(s, FIONBIO, &mode);
return s;
}
}
//returning the number of bytes transmitted
int sendMsg(unsigned int socketID, char s, int len)
{
int ret = 0;
if(socketID == 0) return -1;
ret = send(socketID, s, (len <= BUFFER_SIZE)? len : BUFFER_SIZE , 0);
return ret; // -1 on failure
}
int recvMsg(unsigned int socketID, char c, int len)
{
char tmpC[BUFFER_SIZE];
int ret = 0;
if(socketID == 0) return -1;
ret = recv(socketID, tmpC, len, 0);
if(ret > 0)
{
memcpy(c, tmpC, ret);
}
return ret;
}
void closeSocket(unsigned int socketID)
{
closesocket(socketID);
}
void clearAll(void)
{
WSACleanup();
}
韬客社区www.talkfx.co
发表于:2018-03-07 00:15只看该作者
8楼
/*
* myDLLs.h
*
* Created on: Jan 27, 2016
* Author: Andy
*/
#ifndef COMMDLLS_H_
#define COMMDLLS_H_
#define ST_OK 1
#define ST_UNKNOWN 0
#define ST_ERROR1 -1
#define ST_ERROR2 -2
#define ST_ERROR3 -3
#define ST_ERROR4 -4
#define ST_ERROR5 -5
#define ST_ERROR6 -6
#define ST_ERROR7 -7
#define ST_ERROR8 -8
__declspec(dllexport) unsigned int createHostSocket(void);
__declspec(dllexport) unsigned int createClientSocket(void);
__declspec(dllexport) int sendMsg(unsigned int socketID, char s, int len);
__declspec(dllexport) int recvMsg(unsigned int socketID, char* c, int len);
__declspec(dllexport) void closeSocket(unsigned int socketID);
__declspec(dllexport) void clearAll(void);
#endif /* COMMDLLS_H_ */
韬客社区www.talkfx.co
发表于:2018-03-07 00:16只看该作者
9楼
刚才贴个通信C程序,审核中
韬客社区www.talkfx.co
发表于:2018-03-07 00:26只看该作者
10楼
/*
* myDLLs.c
*
* Created on: Jan 27, 2016
* Author: Andy
*/
#include "commDLLs.h"
#include "winsock2.h"
#include "stdlib.h"
#define BUFFER_SIZE 1024
//returning host listening socket ID
unsigned int createHostSocket(void)
{
WSADATA wsaData;
SOCKET ListeningSocket;
//SOCKET NewConnection;
SOCKADDR_IN ServerAddr;
//SOCKADDR_IN ClientAddr;
int Port = 10002;
//int ClientAddrLen;
//unsigned long mode = 1;
//int maxRetry = 5;
int ret = 0;
WSAStartup(MAKEWORD(2,2), &wsaData);
// Create a new socket to listen for client connections.
ListeningSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if(ListeningSocket == -1) return 0;
// Set up a SOCKADDR_IN structure that will tell bind that we
// want to listen for connections on all interfaces using port
// 10002 Notice how we convert the Port variable from host byte
// order to network byte order.
ServerAddr.sin_family = AF_INET;
ServerAddr.sin_port = htons(Port);
ServerAddr.sin_addr.s_addr = htonl(INADDR_ANY);
// Associate the address information with the socket using bind.
ret = bind(ListeningSocket, (SOCKADDR *)&ServerAddr, sizeof(ServerAddr));
if(ret == -1)
{
closesocket(ListeningSocket);
return 0;
}
// Listen for client connections. We used a backlog of 5, which
// is normal for many applications.
ret = listen(ListeningSocket, 5);
if(ret == -1)
{
closesocket(ListeningSocket);
return 0;
}
//ioctlsocket(ListeningSocket, FIONBIO, &mode);
SOCKADDR_IN ClientAddr;
int ClientAddrLen;
ClientAddrLen = sizeof(struct sockaddr_in);
SOCKET NewConnection = 0;
NewConnection = accept(ListeningSocket, (SOCKADDR *)&ClientAddr,&ClientAddrLen);
if(NewConnection == -1)
{
closesocket(ListeningSocket);
WSACleanup();
return 0;
}
else
{
//ioctlsocket(NewConnection, FIONBIO, &mode);
closesocket(ListeningSocket);
return NewConnection;
}
return ListeningSocket;
}
韬客社区www.talkfx.co
发表于:2018-03-07 00:26只看该作者
11楼
//returning client socket ID
unsigned int createClientSocket(void)
{
WSADATA wsaData;
SOCKET s = INVALID_SOCKET;
SOCKADDR_IN ServerAddr;
int Port = 10002;
int iResult = 0;
unsigned long mode = 1;
// Initialize Winsock version 2.2
WSAStartup(MAKEWORD(2,2), &wsaData);
// Create a new socket to make a client connection.
s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if(s == -1)
{
WSACleanup();
return 0;
}
// Set up a SOCKADDR_IN structure that will be used to connect
// to a listening server on port 5150. For demonstration
// purposes, let's assume our server's IP address is 136.149.3.29.
// Obviously, you will want to prompt the user for an IP address
// and fill in this field with the user's data.
ServerAddr.sin_family = AF_INET;
ServerAddr.sin_port = htons(Port);
//ServerAddr.sin_addr.s_addr = inet_addr("192.168.0.100"); //LAN
ServerAddr.sin_addr.s_addr = inet_addr("127.0.0.1"); //ocal
// Make a connection to the server with socket s.
iResult = connect(s, (SOCKADDR *) &ServerAddr, sizeof(ServerAddr));
if(iResult == -1)
{
closesocket(s);
WSACleanup();
return 0;
}
else
{
ioctlsocket(s, FIONBIO, &mode);
return s;
}
}
//returning the number of bytes transmitted
int sendMsg(unsigned int socketID, char s, int len)
{
int ret = 0;
if(socketID == 0) return -1;
ret = send(socketID, s, (len <= BUFFER_SIZE)? len : BUFFER_SIZE , 0);
return ret; // -1 on failure
}
int recvMsg(unsigned int socketID, char c, int len)
{
char tmpC[BUFFER_SIZE];
int ret = 0;
if(socketID == 0) return -1;
ret = recv(socketID, tmpC, len, 0);
if(ret > 0)
{
memcpy(c, tmpC, ret);
}
return ret;
}
void closeSocket(unsigned int socketID)
{
closesocket(socketID);
}
void clearAll(void)
{
WSACleanup();
}
点评
发表于 2018-03-07 00:57
韬客社区www.talkfx.co
发表于:2018-03-07 00:44只看该作者
12楼
#define BUFFER_SIZE 1024
//returning host listening socket ID
unsigned int createHostSocket(void)
{
WSADATA wsaData;
SOCKET ListeningSocket;
//SOCKET NewConnection;
SOCKADDR_IN ServerAddr;
//SOCKADDR_IN ClientAddr;
int Port = 10002;
//int ClientAddrLen;
//unsigned long mode = 1;
//int maxRetry = 5;
int ret = 0;
WSAStartup(MAKEWORD(2,2), &wsaData);
// Create a new socket to listen for client connections.
ListeningSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if(ListeningSocket == -1) return 0;
// Set up a SOCKADDR_IN structure that will tell bind that we
// want to listen for connections on all interfaces using port
// 10002 Notice how we convert the Port variable from host byte
// order to network byte order.
ServerAddr.sin_family = AF_INET;
ServerAddr.sin_port = htons(Port);
ServerAddr.sin_addr.s_addr = htonl(INADDR_ANY);
// Associate the address information with the socket using bind.
ret = bind(ListeningSocket, (SOCKADDR *)&ServerAddr, sizeof(ServerAddr));
if(ret == -1)
{
closesocket(ListeningSocket);
return 0;
}
// Listen for client connections. We used a backlog of 5, which
// is normal for many applications.
ret = listen(ListeningSocket, 5);
if(ret == -1)
{
closesocket(ListeningSocket);
return 0;
}
//ioctlsocket(ListeningSocket, FIONBIO, &mode);
SOCKADDR_IN ClientAddr;
int ClientAddrLen;
ClientAddrLen = sizeof(struct sockaddr_in);
SOCKET NewConnection = 0;
NewConnection = accept(ListeningSocket, (SOCKADDR *)&ClientAddr,&ClientAddrLen);
if(NewConnection == -1)
{
closesocket(ListeningSocket);
WSACleanup();
return 0;
}
else
{
//ioctlsocket(NewConnection, FIONBIO, &mode);
closesocket(ListeningSocket);
return NewConnection;
}
return ListeningSocket;
}
韬客社区www.talkfx.co
发表于:2018-03-07 00:57只看该作者
13楼
AlwaysRemember 发表于 2018-3-7 08:26
//returning client socket ID unsigned int createClientSocket(void) {
韬客社区www.talkfx.co
发表于:2018-03-07 10:59只看该作者
15楼
这个是要MARK一下的...
韬客社区www.talkfx.co
发表于:2018-03-07 11:19只看该作者
16楼
zsmtk 发表于 2018-3-6 19:45
万元户酸千元户, 千元户怼百刀党, 百元党笑模拟盘。 其实讽与被讽者都一个德性,别叫屈莫喊冤!
韬客社区www.talkfx.co
发表于:2018-03-07 12:45只看该作者
17楼
韬客社区www.talkfx.co